Field mandatory depending on the selection of resolution

Aswathi D April 12, 2023

Hi 

In on of the transition screen , two fields are there "resolution "field with values done , reject, duplicate

And other field fix version 

 

I need to make the fix version field mandatory only if the resolution is selected as done .

If the resolution is selected as rejected or anything other than done ..then fix version should be optional .

How can I do this 

2 answers

1 accepted

2 votes
Answer accepted
Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 12, 2023

Hi @Aswathi D 

Do you have any app ? I would say that it's not possible using only JIRA. Scriptrunner or JSU or Jira Workflow Enhancer may be the solution here but there is many of them that may fulfil your requirements, let me know what you have.

 

It will be a validator.

 

Regards

Aswathi D April 12, 2023

Hi @Florian Bonniec 

We have script runner and JSU

Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 12, 2023

I would use a Simple Script validator for that.

https://docs.adaptavist.com/sr4js/latest/features/workflows/validators/built-in-validators/simple-scripted-validators

https://library.adaptavist.com/entity/duplicate-check?tab=dataCenter

 

If you adapt the example in the documentation, it should look like that:

issue.resolution.name != "Done" || issue.fixVersions

Regards

Aswathi D April 13, 2023

Hi ,

In which of the below option IScript.PNG need to add this ?

Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 13, 2023

None of them, you have to go to the transition where the screen is. Then add a validator on it, select simple scripted validator.

 

Regards

Aswathi D April 13, 2023

Thankyou so much 

It helps 🙂

0 votes
Floating electron
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.
May 8, 2024

Hi, 

The described case can be addressed using any Jira expression-based validator 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 is as follows:

issue.resolution != null && issue.resolution.name == 'Done' 
? issue.fixVersions.length > 0
: true

I hope it will help.

Cheers

Suggest an answer

Log in or Sign up to answer