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 all,
I have a custom field (cuscading select) and when i do update its sometime change value but sometime dont change. I do it with this code:
def muIssue;
def commentManager = ComponentAccessor.getCommentManager();
def issueManager = ComponentAccessor.getIssueManager();
def issue = event.getIssue()
def issueKey = issue.getProjectObject().getOriginalKey()
def catApp = issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("field 1")).toString()
def catApp1 = issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("field2")).toString()
def catSupObject = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("field3")
def issueManager1 = ComponentAccessor.getIssueManager()
def issueIndexingService = ComponentAccessor.getComponent(IssueIndexingService)
def issueType = issue.getIssueType().getName()
def issueService = ComponentAccessor.getIssueService()
def linkType = ["link type"]
def linkMgr = ComponentAccessor.getIssueLinkManager()
for (IssueLink link in linkMgr.getOutwardLinks(issue.id)) {
def destIssue = link.getDestinationObject()
if (linkType.contains(link.issueLinkType.name)) {
muIssue = issueManager.getIssueObject(destIssue.getId())
log.warn(issue.equals(destIssue))
if(!issue.equals(destIssue)){
OptionsManager optionsManager = (OptionsManager)ComponentManager.getComponentInstanceOfType(OptionsManager.class); Object cValue = catSupObject.getValue(muIssue)
if(issueType.equals("xxx")&&catApp.equals("yyy")){
Map<String,Object>newValues = new HashMap<String, Object>();
Long parrentID = 20893
Long childID = 20895
def parentOptionObj = optionsManager.findByOptionId(parrentID)
def childOptionObj = optionsManager.findByOptionId(childID)
newValues.put(null, parentOptionObj)
newValues.put("1", childOptionObj)
catSupObject.updateValue(null, muIssue, new ModifiedValue(cValue, newValues), new DefaultIssueChangeHolder());
}
}
}
}
issueIndexingService.reIndex(issueManager.getIssueObject(muIssue.id));
Maybe somebody know how to fix it?