Forums

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

Scriptruner: Limit to choose value in Select Single customfield based on the query

uvo3 main public name
Contributor
July 20, 2023

How to limit values of Select list (single choice) type custom Field in the Project for selecting (choosing).
Is it possible to script behavior script which shows part of values based on the query.

Example:
I have Single Select field customfield_1 . The values : one, two, three.
When I select value one in the ticket than only two values be able to select in an another ticket.

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
July 20, 2023

Hi @uvo3 main public name

In your description, you mentioned:-

If the value was selected(taken) by another ticket. User can not use the value more than one time.
The message returns as "The value was taken ticket $number"

Let's say the Single Select List has only 5 options, and 5 tickets have already been created. Each one of the tickets has selected a different option from the list.

If a 6th ticket is being created based on what condition will it allow an option from the list to be selected since all 5 options have been selected by other tickets resulting in the list being empty?

Please provide this clarification so I can provide a sample code.

Thank you and Kind regards,

Ram

uvo3 main public name
Contributor
July 20, 2023

Hello!
Thank you for your time.

In our scenario the single select customfield is optional.
The aim of assignment is the ticket has one uniq value of the field.

In case when all values were taken for others tickets
the user not be able to chose any value in the field.
All selected value return a message to the user at the end.

The value can be applied later if some of the ticket resolved.

Suggest an answer

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

Atlassian Community Events