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.
I am trying to match a custom field's value from a "Project" issue type into a "Feature" issue type, on update. These issue types are linked via the Parent Link field.
ie. My custom field is called "Issue Category." If I update that field on the Project issue, I would like all linked Feature issues to automatically update, to match.
Below is what I have so far...a mix of real code w/ psuedo-code
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.comments.CommentManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.link.IssueLink
Issue issue = event.issue
def change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == "Issue Category"} // this should grab changes between linked issues, not child issues?
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def field = customFieldManager.getCustomFieldObjects(event.issue).find { it.name == "Issue Category" }
def parentLink = customFieldManager.getCustomFieldObjectByName('Parent Link') // getting the Parent Link custom field
def featureValue = issue.getCustomFieldValue(field)
def issueManager = ComponentAccessor.getIssueManager();
def customFieldValue = issue.getCustomFieldValue(parentLink) // Parent Link field value
def parentKey = (String) customFieldValue
def parentIssue = issueManager.getIssueObject(parentKey) // Parent issue object
def parentValue = parentIssue.getCustomFieldValue(field)
// HERE IS WHERE I NEED HELP!!
if (parentValue == changed) then featureValue = parentValue
Sorry Judeboy, looks like no can help you out....shout out my adaptivist peeps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.