Changing checkbox selection using SIL

salman_kagzi September 14, 2014

Do you guys have some tutorial on how more checkboxes can be selected using SIL?

In an issue I have some value already set in a Custom Field of type Checkbox. I need to add more to the selected checkboxes, but I cant find a way to get available values and mark them as checked for that issue. Is this even possible using SIL?

If yes, can you point me to the API or tutorial or something?

If no, is there a workaround for this?

2 answers

0 votes
Jonathan Muse
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.
March 11, 2015

I have used lfExecuteJS to call a script to set values of things:

AJS.$(document).ready(function() {
var project = AJS.$("#project-field").val();
if(project=="ABC")
{
AJS.$("#customfield_11600 option[value=11202]").attr("selected", true); 
}
else if(project=="123")
{
AJS.$("#customfield_11600 option[value=11220]").attr("selected", true); 
}
else if(project=="XYZ")
{
AJS.$("#customfield_11600 option[value=11216]").attr("selected", true); 
}
});
Silviu Burcea
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.
March 11, 2015

This will not work on every screen. That's the magic of Live Fields. We handle all these cases for you.

Jonathan Muse
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.
March 11, 2015

Good to know, thanks Silviu!

0 votes
Silviu Burcea
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.
September 14, 2014

Hi Salman,

 

You can use the Live Fields routine lfSet to change the checkbox selection. We don't have any routines to get the available options for a field, but you can create an improvement on http://bugs.kepler-rominfo.com/.

Best regards,

Silviu

salman_kagzi September 14, 2014

lfSet can only be used to set the value on Screen. Can simply do %issueKye%.fieldName = {Val1, Val2} ? Will it save Val1 & Val2 as values on the Server? And what happens when one of the Value is not available for the Checkbox?

Silviu Burcea
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.
September 14, 2014

@Salman Kagzi Yes, you can change it using this syntax, it will save any valid option. If only Val1 is a valid option, Val2 will be ignored. If they are both valid, they will be saved, of course.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events