Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid validation of users in the fields when transitioning issue with groovy?

Sandra Priedīte September 11, 2023

Hello,

I have a situation very often, when I need to do some changes to the issue, but there is an inactive user in one of the multi-user fields. Change doesn't involve the field, so makes no sense for this overall validation of all fields to take place. There can be old issues with inactive users, and it is not possible to clear all inactive users in all old issues.

Usually I avoid this by using issue.setCustomfieldValue() instead of using IssueService.

But now I need to do automatic transition where all post-functions must be executed.

I can't do that, because if there will be inactive user in some multi-picker field (completely unrelated to the transition), transition will throw an error.

Is there a way to skip these validations of fields? 

The expected result is that issue can be transitioned using Groovy and all post-functions are executed even if there are some inactive users in fields.

 

1 answer

1 accepted

2 votes
Answer accepted
Sandra Priedīte September 11, 2023

Nevermind. As in 99% cases, after a question was asked, I found how to do it:

issueInputParameters.setRetainExistingValuesWhenParameterNotProvided(true,true)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events