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.
Current situation:
Wish
Current implementation
I've the following condition
issueLinkManager.getOutwardLinks(issue.id)*.destinationObject!(cfValues['Set Reported Issue Public?']?.value == "No"
However, I'm getting an error:
Script270.groovy: 1: expecting EOF, found '!' @ line 1, column 62. s(issue.id)*.destinationObject!(cfValues
Not sure how to implement the condition.
Hey @Berry Kersten, in this case, if you're accessing a custom field value from your project X within a post function in your project Y, the issue in Y would have an inward link to X. I would slightly change your condition code to something like:
issueLinkManager.getInwardLinks(issue.id)*.destinationObject*.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_<id>")).equals("No")
Even fixing it, I believe you will probably find some challenges to make it work. If I'm not mistaken, in the create transition, you will not have access to the linked issue object before it gets indexed.
Perhaps, as an alternative and way less painful, through the Clones an issue, and links post function in project X, in Additional issue actions, you can add the following snippet
def cf = customFieldManager.getCustomFieldObjects(sourceIssue).find {it.name == 'Set Reported Issue Public?'}
if (sourceIssue.getCustomFieldValue(cf).toString().equals("No")) {
issue.setSecurityLevelId(<id>)
}
I hope it helps,
IL.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.