Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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
Community showcase
Published in Jira Service Management

ThinkTilt is joining the Atlassian Family!

This morning, Atlassian announced the acquisition of ThinkTilt , the maker of ProForma, a no-code/low code form builder with 700+ customers worldwide. ThinkTilt helps IT empower any team in their or...

267 views 16 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you