This article provides the code snippet to unselect an option in a multi-select field using Set issue fields post-function.
Navigate to the intended workflow to make the necessary changes in the edit mode.
Select the required transition.
Select the Post functions tab and click Add post function
.
Add the Set issue fields post-function.
Select the issues, for which the field should be set, under “Target Issue(s)”.
Select the desired field and add the below Nunjucks template:
{{ issue.fields.customfield_10067 | filter(["value","Item 3"],true) | join(',',"value") }} |
Replace 10067
with the id of the desired field and Item 3
with the option to be removed.
With this, the option “Item 3” will be removed from the selected options (if it exists).
If this post-function is added on the create transition, select the checkbox “Delay the execution of this post-function” under “Delayed execution” and select a delay of 3 seconds. |