Changing checkbox selection using SIL

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

This widget could not be displayed.

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

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?

@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.

This widget could not be displayed.

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); 
}
});

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

Good to know, thanks Silviu!

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Canada

AUG Lunch Roundtable - August 13 - Highlights

Thanks to everyone who came out today for the lunch AUG - we had some great food and discussion (and ice cream sandwiches to fend off the heat!) The welcome and fun fact was great as well, what an aw...

30 views 1 3
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you