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

How to make field mandatory depending on specific label?

Yuval Bar Lev July 2, 2024

I what to make some fields mandatory when moving from one status to another(this I know how to do), 
but I want them to be mandatory only when certain label exists 
How can i do it?

1 answer

1 vote
Bibek Behera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 2, 2024

@Yuval Bar Lev 

Welcome to the community. I assume you are trying to pull this off using the condition/validator in the workflow?

 

Could you please share an example of what you mean by "want them to be mandatory only when certain label exists"

Ideally using a screen will help.https://confluence.atlassian.com/jirakb/map-a-screen-to-a-workflow-transition-in-jira-company-managed-projects-720634253.html

-Bibek 

Yuval Bar Lev July 2, 2024

Hi, 

example: 

in Bugs, making RCA fields as mandatory when changing their status to 'ready for QA' but only when the bug has labels 'regression' & 'staging'

Yuval Bar Lev July 2, 2024

we have a screen pop up when changing the status that present the RCA fields 
but we want to make them mandatory 

Bibek Behera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 2, 2024

 

@Yuval Bar Lev I can only think of your standard bug workflow and include the below suggestion on those. <Testing on sandbox is suggested>

  • Edit the workflow and select the transition to "Ready for QA".
  • Add a condition to check if the labels contain "regression" and "staging".
  • Add validators to ensure the RCA fields are mandatory if the condition is met.
  • Use a scripted validator for advanced label checks if needed.
  • Publish the workflow to apply changes.

 

Like Ingo Volkhausen likes this
Yuval Bar Lev July 7, 2024

Hi
on workflow from status A to status B
I created 2 conditions from type VALUE FIELD, first on the field "labels" = regression  and second "labels"= stg 
I chose all on the conditions list (as i want it to be both)

then on that same workflow I created validator from type FIELD REQUIRED VALIDATOR ,
on the field RCA != empty

but for some reason after I published i didn't have the option to move items from status A to status B as Status B didn't appear on the status list anymore 

any idea why?
should it work on basic Jira license?

(which condition \ validator types i should use?
i didnt see the option to write the condition "if label exists"...)

Fiona Brown
Contributor
July 18, 2024

I also need to do this. I was going to use @Bibek Behera

suggestion but adding the condition to the transition will mean the transition won't be possible unless the label is on the ticket which is not what we want. This is the problem you're experiencing @Yuval Bar Lev 

Are there any ways to achieve this ?

Maciej Dudziak _Forgappify_
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, 2024

Hi @Fiona Brown 

If you are open to use apps, maybe you could try Jira expression based validator.  There are several options available on the Atlassian marketplace.

I am from Forgappify, and we developed Jira Expression Validator, which is part of the Workflow Building Blocks for Jira free app.

The expression you need will be similar to the following:

issue.labels.includes('LabelA') ? issue.customfield_12345 != null : true

You need to change the ID of the custom field to a valid one. In the editor, after 'issue.', start typing the name of the field, and you will get suggestions with the correct value.

I am leaving a link to the app's documentation if you are interested.

Cheers

Suggest an answer

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

Atlassian Community Events