SIL Script - Based on the select value..how to ADD a user or mltiusers to a multi user custom field?

Sami Shaik
Contributor
July 26, 2020

Hello there, could someone help me in the follow scenario using SIL SCRIPT FOR Jira Server.

 

Based on the selection of an item from the select list custom field..how to ADD a user or multiple users to a multi user custom field?

 

Regards, 

Sami Ahmed Shaik.

1 answer

0 votes
Andrew Laden
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.
July 27, 2020

Which part do you need help with?

  1. The "if" condition (ie if "Item" is selected from my_select_list_customfield)
  2. adding user to a multiuser custom field?

Or do you need both?

Sami Ahmed Shaik
Contributor
July 27, 2020

Thanks so much @Andrew Laden  for the response, how can we do both ? Appreciate it. 

Andrew Laden
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.
July 30, 2020

For your first part, are you using a single select list or a multi select list? That will affect the code.

For a single select list you could do

if ( #{single_list} == value) { 
do stuff
}

For a multi select, you treat it as an array

if ( arrayElementExists(#{select_list},value)) {
do stuff
}

 

Adding a user to a multiuser custom field is also an array operations

arrayAddElementIfNotExist(#{MultiUserList}, user)

 

Look at the array routines on the SIL documentation page 
https://confluence.cprime.io/display/SIL/Array+routines

Suggest an answer

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

Atlassian Community Events