Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Nested If statements in jira with scriptrunner

Louis Andrews February 7, 2022

Hello I am trying link issues through scriptrunner if they have matching custom fields but are two different issue types. 

For example:

If issue type "A" ID #  = issue type "B" ID #

then link issues with "has ID #"

 Issue types A & B are custom issue types

ID # is a custom issue field. 

Has ID # is a custom link 

 

This also can be looked at as: 

if issue type (A & B) ID # = each other

then link them with "has ID  #" 

Can someone please help me write this scriptrunner? It cannot be done with automation to my knowledge. 

1 answer

0 votes
Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2022

Hi @Louis Andrews 

I believe using switch case will be convenient, readable and a bit more manageable in future. Take a look here on how to use it in Groovy. Did you search here on the community, there are plenty of examples.

Ravi

Suggest an answer

Log in or Sign up to answer