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
What about the JJUPIN custom field mapping - for the multicheckboxes mapping is set (cannot chagne it)
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When is the SIL script fired?
P.S You can add another comment to this post instead of new answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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", "");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When the custom field is changed
I have a Live Fields script that call the SIL script when the custom field changes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.