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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,462,567
Community Members
 
Community Events
176
Community Groups

Workflow validator for specific issue type

I'm looking to add a workflow validator for a Bug issue type only, that makes a custom field (Severity) required. Basically something like If Bug, then Severity is required. Else severity is not required.

3 answers

2 accepted

Hi @Fletcher Wu ,

while this might not be doable out of the box, if evaluating an additional app is applicable for you, I'd like to suggest having a look at Jira Workflow Toolbox.

Given its boolean (or "logical") validators, an expression as simple as this one will do the trick

%{00014} = "Bug" IMPLIES %{10001} != null

where 00014 is the default for issue types and 10001 would have to replaced with the matching Id of your severity field. See other examples for those validators here.

-

Update Feb 18, 2021

Since the latest major release 3.x we've introduced readable field codes resulting in the following expression for the example above:

%{issue.issueType} = "Bug" IMPLIES %{issue.cf10001} != null

Disclaimer: I'm part of the team behind the aforementioned app.

Cheers
Thorsten

Thanks I can give this a try, I requested from my IT team to try the trial out

1 vote
Answer accepted

Hi @Fletcher Wu ,

Take a look and see if you already have an add on installed, such as ScriptRunner, Jira Workflow Toolbox (as above). Or our app, Jira Misc Workflow Extensions (JMWE). "Field required" validator will help with this issue. The library of validators, conditions, and post-functions will help you extend your workflows and support other use cases. You can try all these apps for free

* * *

From the most recent response below, by David Fischer:

For Jira Server/Data Center:

To make the field mandatory if the issue is a Bug or Defect, you can use a Fields Required Validator (JMWE app), select the mandatory field, and use this Conditional Validation script:

issue.get("issuetype").name in ["Bug","Defect"]

If the issue is not a Bug nor a Defect than use:

!(issue.get("issuetype").name in ["Bug","Defect"])

For Jira Cloud, the same validator use case can be found here.

* * *

Good luck,

Inna

Hi Inna

My project does have the JMWE extension for "Field required", and I did try this out however I could not figure out how to limit it to a specific Issue Type. I only want my field Severity to be required for Bug issue types, however when I try to add it via JMWE, other issue types also require it. It seems I need to add a conditional validation, however I can't figure out the Groovy expression =( Would you be able to assist me?

Hi Fletcher,

In that case, select the "Conditional Validation" option in the validator, and input the following script:

issue.issuetype.name == "Bug"

Regards,

Radhika

Thank you @Radhika Vijji _Innovalog_  that worked! Another quick question if I may, if I wanted to set this validator to 2 different issue types (Bug and Content Bug), how would that look? I tried adding 

issue.issuetype.name == "Bug, Content Bug"

 but that didn't work. Also tried them as separate individual validators, but also no luck. Any advice would be appreciated! 

Hi Fletcher,

you could do:

issue.issuetype.name in ["Bug", "Content Bug"]

Hi All,

i have a specific requirement. I need to have one field should be mandatory during workflow transition but not only for Issue type Bug/Defect. How to apply this?

 

Note: We use common workflow schemes for all projects and issue types.

Regards,

Venkat

Hi @srivenkatbabu sinnasami ,

are you on Jira Server/DC or Cloud?

Hi @srivenkatbabu sinnasami ,

you can use a Fields Required Validator (JMWE app), select the mandatory field, and use this Conditional Validation script:

issue.get("issuetype").name in ["Bug","Defect"]

although I'm not sure if you want to make the field mandatory if the issue is a Bug or Defect, or if the issue is not a Bug nor a Defect. If the latter, use:

!(issue.get("issuetype").name in ["Bug","Defect"])
0 votes

Do you have scriptrunner?  If so, you can easily to that via behaviors. 

https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events