Forums

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

ScriptRunner: How to write condition for limiting one issue type ?

Aisha M
Contributor
February 19, 2019

I want to use the Script Condition [ScriptRunner] in the Workflow.

I want to set up a condition stating that, Issue type of Risks should not go over to the 'Accepted' status.

So, at the transition to 'Accepted', tried adding the below Script condition, but it does not work. Any help of this please,

if(issue.issueType.name == 'RISK')
return false;

1 answer

1 accepted

1 vote
Answer accepted
Tansu Akdeniz
Community Champion
February 19, 2019

Hi @Aisha M ,

The following should work;

issue.issueType.name != 'RISK'

Regards 

Aisha M
Contributor
February 19, 2019

@Tansu Akdeniz  Hi, Thank you for the reply.

I tried using the condition you have mentioned, but it still does move to Accepted. 

Tansu Akdeniz
Community Champion
February 19, 2019

I just tried in my local Jira without a problem. So, you still see the transition button although issutype is risk?

Could you please send me a screenshot of a condition? Also make sure that the name of issuetype is right. There could be a case sensitivity problem?

issue.issueType.name != 'Risk'
Aisha M
Contributor
February 20, 2019

@Tansu Akdeniz 

Yes, It still transitions to Accepted. Well, due to compliance issues, we don't have screenshot enabled; Sorry

We have project wise workflows. So, there are many issue types associated with the workflow.

So, I tried adding the Scriptrunner condition at the Transition step from Ready to accept (status) to Accepted (status)

Maybe do you think I need to add any additional script along with the script line you have mentioned ?

Thanks

Tansu Akdeniz
Community Champion
February 20, 2019

Here it is;

image.png

Btw, if you have JSU add-on, you can also do the following;

image.png

Aisha M
Contributor
February 20, 2019

@Tansu Akdeniz  Thank you so much !!!!!!!!!!!! Its working fine now :)

I think the issue was, I had added the condition to the ' Custom script condition' instead of the 'Simple script condition' 

Tansu Akdeniz
Community Champion
February 20, 2019

You are welcome @Aisha M :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events