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

Need to make few fields required on closing ticket only, not during create ticket

Sasmitha Chalamala March 18, 2022

Out of the below 4 required fields (I made them required) , I want to make the 2 circled ones as required during closing ticket  , but they show as required for ticket creation itself. Any idea how to change it to make them required only for ticket close and not for ticket create?

 

sd1.png

 

 

1 answer

2 votes
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 18, 2022

Hi @Sasmitha Chalamala 

You can go a couple ways with this:

  1. If they are only completed during close, you can remove from the create/edit screens and add to the final transition screen
  2. If they may be filled out during, you would want to create a validator on your final transition.
Sasmitha Chalamala March 18, 2022

Hi, thank you for the response. Your second suggestion is better for us. Can you give some screenshot that shows where to create a validator.

Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 18, 2022

Hi @Sasmitha Chalamala

Take a look at this video tutorial: https://youtu.be/RIKYX-z4meM

Which shows how you can combine a transition screen with a validator.

Regards

Sasmitha Chalamala March 19, 2022

Hi, thank you. I was able to follow the steps till I came to the below options. I do not see the below "Fields Required Validator" option in my list of options. How do I get this option?

sd2.png

Sasmitha Chalamala March 19, 2022

Hi, in my previous comment above , I said I do not see the "Fields Required Validator" option. But I could do the same in a different way by selecting the insight option and adding below groovy script per the instruction there.Then I followed the remaining steps in your video at https://youtu.be/RIKYX-z4meM

I also tested that the new popup came (screenshot below) when i tried to close the ticket. But when i hit the "Close" button in that popup without entering any values in the 2 highlighted fields, it just closed without giving me the error message I set up.

Can you see if the below groovy script is wrong ? I used the correct "ID" for those fields.

--------------------------------------------------------------------------

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.fields.CustomField;

def value = issue.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObject(10302)); // Change ID to the correct one

if !(value >= 0) {
return "Required!";
}
return true

--------------------------------------------------------------------------

 

sd3.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events