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,361,708
Community Members
 
Community Events
168
Community Groups

Conditional Mandatory Fields

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

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

@Neil Atkin -

I agreed with what @Alex Koxaras 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.

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.

Thanks again

Capture.JPG

0 votes
Alex Koxaras Community Leader Sep 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/

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 Community Leader Sep 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.

Ah cool - thanks @Alex Koxaras 

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

An unofficial way to monitor a JSM mail handler for errors

...eturns true if any content is returned for the webResponse.body.data.first s...

718 views 3 20
Read article

Atlassian Community Events