You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi Everyone!
In my organization, our Jira setup has a customField_12000 which is pointed to an object labeled "Affected Objects", there can be multiple Affected Objects", Within these objects is a Contact(s) field with multiple users inside. Does anyone know an easy way to fill this value?
Taking a step back, the goal is really to target an "Affected Object" by itself and not specifically from a linked issue, then to show who is the primary contact for that object through a rest call if possible.
It seems alot of examples help me pull the Affected Object itself but not the contact within?
I messed with the GroovyScript to see if I could get it to load anything and I was able to successfully reflect the name of the affectedobject within the field but not the contact located within that specific object.
Thanks for any Pointers!!
[My failed attempts]
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;
//ComponentAccessor.getCustomFieldManager().getCustomFieldObject(12000); = "Affected Object(s)"
def value = issue.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObject(12000)); // Change ID to the correct one
CustomField myCF = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(12000)
def objectBean = myCF.getValue(issue)[0]
/* If an insight custom field has an object called "Microsoft" it will fail */
if (value != null && "Microsoft".equals(value[0].getName())) {
return "This is not a valid vendor!";
}
//return value[0].getAt(0).name
return objectFacade.loadObjectAttributeBean(value[0].getId(), 12000).getObjectAttributeValueBeans()[0].getValue()
return value[0].toString()
return value[0].getId()
return value[0].getLabel()
return value[0].getClass()
return value[0].getName()
The code above helps return some minor details of the affect object selected at index [0] but what am I missing to get the underlaying attribute?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.