Forums

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

Need assistance on adding a script Listener

Mahesh Babu Batta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 20, 2020

Can you please help me on how can I achieve following requirement.
We need to make two values as mandatory of multi value selection field only while editing or updating the ticket if the ticket is created with only single value while creating a ticket.

 

Thanks

1 answer

0 votes
Nic Brough -Adaptavist-
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.
September 20, 2020

A listener is the wrong place to look.  A listener reacts to an event, after the event has happened.  The edit or transition is complete by the time a listener gets to look at it, too late for validation - the human has committed the data and the service stored it before the listener gets it.

You will need either a validator or a behaviour to do this check.  They both have weaknesses though - validators can only be run on transitions, and behaviours only run on-screen (so REST calls and internal automations can ignore them).  A combination of both might be the best option

I'm not sure how to do a behaviour, they're my weakest area in SR, but https://library.adaptavist.com/entity/set-behaviour-multi-and-single-select-options-and-value might have something you can re-use

If you go the validator route, some snippets can be found at https://library.adaptavist.com/search?page=1&products=jira&term=validator

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events