Forums

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

How to use a transition validator only in certain conditions

David
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.
January 4, 2022

We have 1 workflow for New Features, Changes Requests and Bugs. I want the issue resolution field to be required only for Bugs. I put in a validator in the appropriate transitions to require this field. 

Originally, I added a condition on the transitions that the issue type had to be a bug. What I didn't realize was the condition was set so we could not move the ticket to the next status unless the issue type was a bug.

I have fixed this issue, but I do not know how to require the Issue Resolution field for only Bugs, but not the other issue types. 

I went down the validator path because setting a field as required is global which I don't want. Looking for any suggestions on how to require a field for Bug, but not other issue types.

2 answers

1 accepted

1 vote
Answer accepted
Claudio Gonzalez
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.
January 4, 2022

Hi @David ,

For me the better way is duplicate the workflow and after assign the new workflow only to bug issue type.

For example.

Workflow_Scheme

     - Workflow_1 (New Features - Changes Request)

     - Workflow_1_bug (Bugs)

 

After then, you can set into transition of "Workflow_1_bug" a condition for resolution field is not empty

David
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.
January 4, 2022

I hate managing more workflows when they are 99% the same, but your suggestion is probably the best thing to do.

Thanks

0 votes
Gajanan Sasane
Contributor
July 11, 2023

Hi @David,
If you are using the JMWE plugin then use the below validators to achieve your requirement.

Field Required Validator

In the condition you can just specify issue.get("issuetype")?.name == "Bug" and select the field which you need to be required.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events