Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to set issue security level depending on custom field condition?

Current situation:

  • ScriptRunner Post function 'Clones an issue, and links' used for cloning an issue from project X to project Y
  • In project Y the Security Level is automatically set to 'Internal'  (by using a the post function 'Set issue security level depending on provided condition" on the create transition)


  • Set the Security Level based on a condition:
    • IF custom field in original issue in project X "'Set Reported Issue Public?" = "Yes", THEN set Security level to "Public"
    • IF custom field in original issue in project X "'Set Reported Issue Public?" = "No", THEN set Security level to "Internal"

Current implementation

I've the following condition

issueLinkManager.getOutwardLinks(*.destinationObject!(cfValues['Set Reported Issue Public?']?.value == "No"

However, I'm getting an error:

Script270.groovy: 1: expecting EOF, found '!' @ line 1, column 62.

Not sure how to implement the condition. 

1 answer

1 accepted

0 votes
Answer accepted

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:


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 { == 'Set Reported Issue Public?'}

if (sourceIssue.getCustomFieldValue(cf).toString().equals("No")) {

I hope it helps,

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events