Forums

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

Want to make a field mandatory on transition for certain types of issues only

Lydia Hawkridge
Contributor
November 30, 2023

Hi all,

I have a field called "root cause" on bugs and I would like to make this mandatory to be filled out when the issue moves from IN PROGRESS to DEV COMPLETE status.

I followed the steps to set up a validator which worked, HOWEVER, even although the field is only configured to show for bugs and sub-bugs, the validator was blocking all issue types from progressing through the aforementioned statuses.

Is there something additional I need to do, or is there another way to achieve this?

Essentially I want to prompt my development team to add notes as to how the bug was solved once they have done the solving.

Thank you!

4 answers

1 vote
Suprija Sirikonda _Appfire_
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.
December 11, 2023

Hi @Lydia Hawkridge,

Your requirement can be achieved using "Field Required Validator" of "Jira Misc Workflow Extensions" (JMWE) app.

  • Add a JMWE "Field Required Validator" on the IN PROGRESS to DEV COMPLETE transition.
  • Select "Root Cause" in "Field(s)"
  • Select the checkbox “Conditional validation” under “Validator scope” and add the below script:
!!issue.issueType && ["Bug","Sub-bug"].includes(issue.issueType.name)

Add the desired issuetype names in the above array (in double quotes and separated by a comma), for which you want to make the "Root Cause" field mandatory.

With this, you can have a common workflow for multiple issuetypes and still have the "Root Cause" field mandatory only for specific issuetypes.

I hope this helps!

Regards,

Suprija | Appfire

1 vote
Asha Goyal
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.
December 2, 2023

Hello @Lydia Hawkridge 

In addition to copying the workflow for different issuetypes and applying the validator on the required issuetypes, there is an alternate solution:

If you are using JMWE or Scriptrunner on your instance, then you can also try conditional JMWE Field Required Validator or ScriptRunner Script validator in the transition of your workflow.

Hope it helps. Just put a comment if any further help is needed and kindly accept this answer if you find it useful.

Thanks

1 vote
Mohamed Benziane
Community Champion
November 30, 2023

It seems that your are using the same workflow for different issue type. You can duplicate your workflow and use the one with the validator with the corresponding issue type

1 vote
Walter Buggenhout
Community Champion
November 30, 2023

Hi @Lydia Hawkridge ,

Since you mention validators, I may safely assume that you are talking about workflow in company managed projects.

Workflows there are linked to projects using a workflow scheme. In such a scheme, you link workflows to issue types. And so, to make sure you apply this specific validation only to bugs and sub-bugs, make sure to add 2 workflows to your workflow scheme: one that has the validation and one that doesn't. Associate the workflow with the validation to the bug and sub-bug issue types.

Hope this helps!

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