Jira JJUPIN setting custom check box field

William Gunkel April 29, 2014

I created very simple (so I thought) SIL script to make sure a yes / no check box custom field could not be set to both yes and no at same time.

The problem is I can not figure out how to set the field in the SIL script

I know the field is a string array what I can not figure out is how to set it

customfield_14002 = ? -- to select the Yes check box smae for clearing the Yes check box

2 answers

0 votes
William Gunkel April 29, 2014

What about the JJUPIN custom field mapping - for the multicheckboxes mapping is set (cannot chagne it)

0 votes
Alexandru_Iacob
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.
April 29, 2014

Hi William,

The syntax is: customfield_10402="Yes"; for selecting the Yes checkbox, customfield_10402="No"; for selecting the No checkbox, and customfield_10402=""; for clearing the checkboxes. SIL is smart enough to automatically convert the string value to string array.

You may also consider using radio buttons instead of checkboxes, if you only want one value selected at a time.

Kind Regards,

Alex

William Gunkel April 29, 2014

Thanks but not working for me

Here's the code

logPrint("INFO", "Unit test field changed: " + key);
logPrint("INFO", "Unit test index 0: " + customfield_14002[0]);
logPrint("INFO", "Unit test index 1: " + customfield_14002[1]);
customfield_14002=""

-- Did not clear the fields when I checked both the yes & no checkboxes

The log entery shows the field status but the code snip-it is not clearling the checkboxes

Alexandru_Iacob
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.
April 29, 2014

Do you have any errors in the log?

I see a typo in your script: a missing semicolon at the end of the customfield_10402="" statement.

Please let me know also what Jira and jjupin versions are you using and where do you use your SIL script. Also, please attach the entire SIL script. (I suppose what you posted is just a part of it)

Thanks

William Gunkel April 29, 2014

No errors in the log and the missing semicolon was my cut and paste. SIL would flag error when check the file before saving

Only thing I see in the log is the SIL log messges to confirm that the script fired as expected

And thanks for fast response to my update :)

Alexandru_Iacob
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.
April 29, 2014

When is the SIL script fired?

P.S You can add another comment to this post instead of new answer

Alexandru_Iacob
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.
April 29, 2014

Can you please attach the live fields SIL scripts that you are using?

I suppose you have a main SIL script that calls the lfWatch routine on the checkbox routine and executes a hook script.

If this is the case you should try using the lfSet routine in the hook script instead of trying to pass directly the value for the field on issue: http://confluence.kepler-rominfo.com/display/JJUPIN/lfSet

Your statement would be lfSet("customfield_10402", "");

William Gunkel April 29, 2014

When the custom field is changed

I have a Live Fields script that call the SIL script when the custom field changes

William Gunkel April 29, 2014

Here's script as you guessed as a mainSIL script

// check for unit test completed check box change
lfWatch("customfield_14002", {"customfield_14002"}, "UnitTestCompleted.sil", {"change"} );

FYI - tried the 'lfSet("customfield_10402", "");' still did not clear the check boxes

Alexandru_Iacob
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.
April 29, 2014

Please attach also the hook script "UnitTestComplted.sil". If you are checking the checkbox value in the hook script, make sure you use argv["customfield_10402"] and not directly customfield_10402.

Hope this helps.

Alexandru_Iacob
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.
April 29, 2014

I have tested your configuration and everything works as expected.

Do you have this problem on any browser and on any issue screen? What Jira and JJupin version are you using?

William Gunkel April 29, 2014

Currently not doing anything in the script since during test was not able to set / clear fields

Here's full script

// Script to make sure unit test completed check box is not set to yes & no both
// Created by W Gunkel April 24 2014

logPrint("INFO", "Unit test field changed: " + key);
logPrint("INFO", "Unit test index 0: " + customfield_14002[0]);
logPrint("INFO", "Unit test index 1: " + customfield_14002[1]);
lfSet("customfield_10402", "Yes");

William Gunkel April 29, 2014

Jira 5.2.11

JJupin Version: 2.5.13

Alexandru_Iacob
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.
May 4, 2014

I just tested also on Jira 5.2.11 with JJupin 2.5.13 and couldn't reproduce the problem.

Please let me know what browser are you using and on which issue screens are you experiencing the problem and also check for any related errors in the log file.

Thanks

William Gunkel May 4, 2014

I have tried with Chrome 34.0.1847.131 and FF 28 same results. Fact that you cannot reproduce the issue (and thanks for the help) make me wonder if my Jira sandbox is valid environment. I will do some addtional checking

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events