It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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.

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
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Expose your beautifully crafted Dashboard through the Jira Service Desk Customer Portal

  A picture is worth a thousand words, especially when you're trying to find relationships and understand your data. Here, Dashboards play a vital role in gaining insights from a variety of dat...

337 views 5 4
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you