Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Automation

Harshit Grover
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 7, 2025

I have Service Desk project by the name of "ABC".
In that , I have a issue type "General Request"
In General Request , I have many fields...two of the fields are Ticket Type and Job Code.

Ticket Type is a single select drop down field. (it has many values.)
Job Code is a Text field.

Now, I want a automation where whenever issue type is General request, Ticket type is Repo/Space Creation , then during closure of the ticket, Job Code should be mandate. (It should only be mandate when ticket type is Repo/Space Creation). For other values within ticket type it should work as it is.

 

Can someone help me with the detailed automation for this ?

4 answers

0 votes
Cristiano Alves -Appfire- May 23, 2025

Hello @Harshit Grover 

Cristiano from the appfire team here.

Unfortunately, you will not be able to do this natively,

Allow me to suggest solving this issue by using Jira Misc Workflow Extensions (JMWE), you can use the Field Required Validator (JMWE app), that allows you to make a field required but with optional validation.

For you specific case, I recommend doing it like this:

image.png

issue.issueType.name == "General request" && issue.customfield_10124.value == "Repo/Space Creation"

 


Just remember to change the custom field value to match your instance, or the error message if you desire.

Please contact our support if you have any other questions about this validator, or JMWE in general. 

0 votes
Nacho Moreno Ortega
Contributor
May 8, 2025

Hello Harshit Grover,

I am Nacho and i am part of Decadis.

Your requirement can be solved with a jira expression validator from our app Jira Workflow Toolbox for Jira Cloud.

An expression like the following one can be used in the jira expression validator in the transition of the ticket closure:

issue?.issueType?.name == "General request" && issue?.customfield_XXXXX?.value == "Repo/Space Creation" ? issue?.customfield_YYYYY != null : true

Please, replace XXXXX with the id of the Ticket Type custom field and YYYYY with the id of the Job Code custom field id.

If you have any doubt, feel free to create a ticket in our Support portal and we will be happy to assist you.

Kind regards,

Nacho

0 votes
Murat Seven
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 7, 2025

Hi @Harshit Grover ,

This process cannot be achieved directly using Jira Automation, as Jira Automation does not support making a field mandatory directly. In other words, it's not possible to enforce a rule through automation that makes the "Job Code" field mandatory when the "Ticket Type = Repo/Space Creation."

However, you can achieve this requirement through the following alternative solution:

Alternative Solution:

  1. Create a new custom field (for example, a field called "Dummy").

  2. Go to the workflow used for the "General Request" issue type in your project.

  3. On the transition where the ticket is closed, add a validator.

    • The validator should work as follows:

      • If the Dummy field is empty, allow transition (i.e. the ticket can be closed).

  4. Then, create a Jira Automation rule:

    • Trigger: Issue updated, field change, or transition (depending on your needs).

    • Condition: Issue type = General Request AND Ticket Type = Repo/Space Creation.

    • Action: Automatically set the Dummy to any value (e.g., "valid").

How It Works:

  • When the Ticket Type is "Repo/Space Creation," the automation will populate the Dummy field, and the transition will be blocked (i.e., the ticket cannot be closed).

  • For all other ticket types, this field will remain empty, and the validator will allow the transition, so you can manually ensure that the "Job Code" field is filled before closing.

In this way, you are not directly making a field mandatory with automation, but instead, using automation to trigger a transition validator, which helps enforce the required behavior.

If the answer helps, please accept the answer.

 

Best regards,

Murat Seven

 

0 votes
Manoj Gangwar
Community Champion
May 7, 2025

Hi @Harshit Grover 

First, you must create a screen, add the field Job Code, and add the screen to the resolved transition.

Then, you can use the conditional validator on the resolved workflow transition. Make sure you have the JMWE plugin or ScriptRunner installed. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events