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

How to get selected checkbox options in JJupin 3 or SIL

dsvs January 15, 2015

I am using JIRA 6.2.7 and JJupin 3.

1)How do i get only selected checkbox items from checkbox list in sil script?

"getFieldOptions" function returns all the items.

2)How to get all the names of the required cf fields on the issue screen in SIL script or JJupin?

3)How to make some cf fields as required fields based on selected check box items?

thanks

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
FlorinM
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.
January 15, 2015
  1. Accessing the custom field value using one of the accepted notations ( http://confluence.kepler-rominfo.com/display/SIL30/Variable+Resolution#VariableResolution-CustomFields ) will return the selected values.
  2. That's not yet possible using SIL.
  3. You can use a validator to check if a field was filled in only if another field has a certain value (e.g. http://confluence.kepler-rominfo.com/display/TR/Validators#Validators-Forceacustomfieldtoberequiredifanotherfieldwassettoacertainvalue), but it will not mark the field as required in the sense of a JIRA Field Configuration (https://confluence.atlassian.com/display/JIRA/Specifying+Field+Behavior)

 

Hope this helps!

 

dsvs January 16, 2015

Thanks for the info. but I tried to get the selected options by using id or name it is not working. I tried on two controls. Here is my code: //set the options lfSet("Test chkList",{ "optOne","OptTwo"});/* I see options are selected on the issue screen*/ string[] selectedOptions = customfield_10123;/*after this line code is not executing I don't see any error*/ //string[] selectedOptions1 = #{Test chkList}; string results; for(string opt in selectedOption) { results +=opt; } lfSet("inputResults", results);

dsvs January 16, 2015

it is selectedOptions. typo

FlorinM
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.
January 16, 2015

string[] selectedOptions = customfield_10123; will get you the options saved in the DB for that custom field. If you're using this script as a hook script using Live Fields, you should pass {"customfield_10123"} as the dependent fields in the lfWatch() or lfInstantHook() call. If you're using the script as the initial script, you should consider using a lfInstantHook() to pass the currently selected values of customfield_10123 back to the server. See: http://confluence.kepler-rominfo.com/display/JJUP30/lfInstantHook http://confluence.kepler-rominfo.com/display/JJUP30/lfWatch

TAGS
AUG Leaders

Atlassian Community Events