Unset Checkbox Field Value of Linked Issues using JIRA Misc Workflow Extensions

Oded Priva
Contributor
April 2, 2015

Hi, 

I'm trying to use JIRA Misc Workflow Extensions to uncheck a checkbox field type from a related linked issues using Set Field Value Of Linked Issues Function

can it be done ? what should I put in the value box ? 

5 answers

0 votes
David _old account_
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 5, 2015

Oh, you didn't mention it was one of several checkboxes. This is slightly more complicated.
You need to use a Groovy value instead, in which you'll put the script that will remove the option (checkbox value) for the list of currently selected options.

Here's the script, assuming "a" is the value you want to uncheck:

arr = linkedIssue.get("customfield_13601");
if (arr==null) return null;
newValue = []
for (com.atlassian.jira.issue.customfields.option.Option option : arr) {
  if (!option.getValue().equals("a"))
    newValue.add(option);
}
return newValue;

Note that "13601" is the numerical ID of the custom field, which you must adapt to your own case (see https://innovalog.atlassian.net/wiki/display/KB/Using+issue.get%28%3Cfield_name%3E%29+in+scripts for help)

 

MattS
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 11, 2016

Thanks for the tip, David. It's odd that there is no way to just remove an option from a multivalued field. It looks like you had to recreate the wanted content and then set that new value into the field.

0 votes
David _old account_
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 2, 2015

Using JMWE's Set Field Value Of Linked Issues Function, you might want to try with an empty string as the value, or maybe "-1", I'm not sure.

I assume you're using a "Checkboxes" field type, right?

Oded Priva
Contributor
April 4, 2015

Yes, I am using checkbox field type .. But how do I point to the specific option ? ?

0 votes
Cesare Jacopo Corzani
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 2, 2015

You may want to use a scriptrunner postfunction:
https://jamieechlin.atlassian.net/wiki/display/GRV/Post+Functions

You can take a look at the example "Auto close all subtasks" of how to create a transition.
https://jamieechlin.atlassian.net/wiki/display/GRV/Post+Functions#PostFunctions-Autocloseallsub-tasks

You may check at this to retrieve the links of the current issue:
https://answers.atlassian.com/questions/198694

0 votes
Oded Priva
Contributor
April 2, 2015

no condition, just change it during a transition post function

0 votes
Cesare Jacopo Corzani
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 2, 2015

Which is the condition of unchecking that checkbox? Do you want to do it in a workflow transaction?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events