Jira script runner Behaviour code for get "N th" item from Custom list
There are 2 Custome list items
One is Customefiled_id_3004 list
Second one is Customefiled_id_3005 (List of items values )
Based on Customefiled_id_3004 selected value will populate data for Customefiled_id_3005
Customefiled_id_3005 contains following options
postion 1: empty(null)
Postion 2: value1
Postion 3: value 2
Upto so on...
Requirement :1) When Customefiled_id_3005 value contains or selected "postion 1: empty(null)" then it replace with other then "postion 1: empty(null)" that means needs to select any of available options
Like
Postion 2: value1 OR
Postion 3: value 2
Requirement :2) if Customefiled_id_3005 list is not having postion 1: empty(null)"
Contains only following way
Postion 1: value1
Postion 2: value 2
Upto so on...
In this case selected value should keep as it is
Conclusion: Customefiled_id_3005 list is not having postion 1: empty(null)" then keep as it is selected value . or else of it is having empty(null) then select any one available option item
Needs to implement behaviour in jira script runner
Please guide Me Thanks