Conditional Mandatory Fields

Neil Atkin September 21, 2022

Hi.  When resolving Incidents i want certain fields to become Mandatory.  But i only want these to be mandatory for P1 or P2 priority incidents and at the resolution stage.

 

I cant find anything obvious where this can be configured.

 

Any help is appreciated - thanks

4 answers

0 votes
Sergio García-Consuegra _Decadis AG_ September 22, 2022

Hi @Neil Atkin ,

I hope you find useful the following information.

This requirement can be achieved with Jira Workflow Toolbox, using our Logical Validator.

After adding it in your "Done" transition, use the following logical expression:

{issue.priority} in [0,1] ? %{issue.summary} != null AND %{issue.cfAAAAA} != null : true

If you were not referring to the "Priority" jira field and you were referring to a specific custom field, then you should use %{issue.cfAAAAA} instead, replacing AAAAA for your custom field code.

If you want to obtain more details about how the logical parser mode works, please refer to this page from our documentation.

If you have any doubt regarding the offered solution feel free to ask!

Thank you.

Best regards,
Sergio

0 votes
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 21, 2022

@Neil Atkin -

I agreed with what @Alex Koxaras _Relational_ stated.  I would recommend that you take a look at JMWE add-on where you can add conditional validator setup (with minimum coding required) in your WF customization. 

It is a great add-on for any Jira/JSM admins and installation -

https://marketplace.atlassian.com/apps/292/jira-misc-workflow-extensions-jmwe?tab=overview&hosting=cloud

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Infrastructure Applications Team

Viasat Inc.

0 votes
Neil Atkin September 21, 2022

Hi @Alex Koxaras _Relational_ 

I had read up on forms but understood these were only used in the portal/front end?  I'm looking for conditional mandatory fields in the back end .  E.g. in the image below, if that incident was a P1/P2 i'd want the 'Unplanned Outage?' custom field to be mandatory at the Resolve stage.

Thanks again

Capture.JPG

0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 21, 2022

Hi @Neil Atkin 

You should use forms, which come as a bundle on every JSM project and associate them with Jira issues. On these forms, you can use conditions to hide/reveal fields, based on input.

https://support.atlassian.com/jira-service-management-cloud/docs/what-are-forms/

https://support.atlassian.com/jira-service-management-cloud/docs/create-or-edit-a-form/

Neil Atkin September 21, 2022

Hi @Alex Koxaras 

I had read up on forms but understood these were only used in the portal/front end?  I'm looking for conditional mandatory fields in the back end .  E.g. in the image below, if that incident was a P1/P2 i'd want the 'Unplanned Outage?' custom field to be mandatory at the Resolve stage.

 

Capture.JPG

Thanks again

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 21, 2022

Aa! Sorry, I didn't understood that you want them for the backend. No, there is no way to do that. Scriptrunner is going to release Behaviors, which will allow you to do these kind of things, but unfortunately it will be limited to a handful of systemic fields, and not custom fields.

You could use transition screens on the workflow and validators to make fields mandatory, based on what the user will input on a field. But you can't control field visibility, meaning that even if the field is not mandatory, it will always be visible.

Neil Atkin September 21, 2022

Ah cool - thanks @Alex Koxaras _Relational_ 

I can see the Validators where I can make a field mandatory at resolution transition.  But i cant see where i can make this mandatory under certain circumstances, i.e. when the Priority = 1 or 2.

I wouldnt want this to apply to all transitions to Resolved.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 21, 2022

You will need an app to do that, like JMWE, JSU, JWT and scriptrunner (more exist).

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events