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

Can I use Power Scripts to create an "If\Then" statement to determine an issue's workflow?

Danny Davidson October 29, 2019

I am trying figure out if I can add an .sil condition to the "create" transition in my workflow where, depending on the value of a particular field, it either goes down "Path 1" or "Path 2" of the workflow.  To give a little more context, I'm aware that you can't create custom epics in Jira, so Im basically trying to create 2 workflows in 1 issue type.

Ex.  EPIC-123 has a field called "Epic Type" (drop down, single-choice field) 

IF EPIC-123, Epic Type = "Type A" THEN Status = "Ready For Review" 

IF EPIC-123, Epic Type = "Type B"  THEN Status = "To-Do" 

 

Something to that effect.  the "Type B" in this scenario is a super simple "To Do, In Progress, Done" that a lot of users don't want modified. But the "Type A" Epic, has a very specific and very different set of steps and validations. 

All this being said, I am open to alternative ideas. I went through a lengthy process of creating an additional issue type, setting up notification schemes, workflow post-functions etc. only to then find out, that I can't leverage Parent Link the same way actual Epics do. Also, can't use epic links, colors, etc. So this .sil script is my Plan B. 

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Alexey Matveev
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.
July 22, 2020

Hello @Danny Davidson ,

I would create a workflow, which would include all necessary statuses for Type A or Type B and then use workflow conditions to show required statuses.

For example,

Let's say you have a status named Open. Then for Epic Type A you need to go from Open to Under Review and for Epic Type B you need to go from Open to To Do.

You create the following workflow:

Screenshot 2020-07-22 at 11.50.14.pngThen you add the following scripts to To Do and Under Review transitions:

To Do:

if #{Epic Type} == "Type A" {
return true;
}
return false;

Under Review:

if #{Epic Type} == "Type B" {
return true;
}
return false;

 As a result if an epic of Type A is in the Open status then only To Do transition will be available. If an epic of Type B is in the Open status then only the Under Review transition will be available.

TAGS
AUG Leaders

Atlassian Community Events