Hi all,
I have a problem when updating object attribute from a post function jira issue.
here is the situation :
Insight : objectType :
Name Type Value
objA objTypA
objA2 objTypA
objA3 objTypA
objB objTypB
objB2 objTypB
objC objTypC
...
After closing a ticket, I assign a value (like objA, objB...) on a Insight Custom Field on next issue. This value is based on another custom field value (like 'objTypA'...).
Depending of this last value, the Insight object custom field is fill with a random Insight Object from "objectType", WHEN Value is not empty.
The problem is when I try to update "Value" Attribute from "objectType" with a value ("1" by instance).
For this, I use this script : https://documentation.riada.se/display/ICV54/Update+object+attribute. But the problem is when script has run, it updates all attributes from "objectType" fill on custom field (i.e if Insight Custom Field has "objA3" assigned, all Objects objA, objA2 and objA3 are updated with value "1", because the other custom field is "objTypA").
but when I update script with "insightObjects
[0]" instead passing on For statement, the first object is update, even if this is another value filled on Insight Custom Field.
How I can force update of the good object in Insight ?
hope to be clear.
Regards,
Hi,
You can update your script to be something like :
import com.atlassian.jira.component.ComponentAccessor;
/* The object facade class */
Class objectFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade");
/* The reference to the object facade which you can use in your code */
def objectFacade = ComponentAccessor.getOSGiComponentInstanceOfType(objectFacadeClass);
storeObjectAttributeBean(objectFacade.loadObjectBean("ObjectKey").getId());)
For more information on the groovy syntax : insight-core
You could also use a hidden custom field and set the latest value from your objA3 into and then read it in any postScript and write to any field you wish
Best regards,
Nader
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.