Forums

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

ensure resolution is not unresolved

Steve Bland June 19, 2019

I am trying to ensure the resolution field has a value, any value other than null, which seems to be interpreted as not resolved 

these were  recommended and make logical sense, but do not work

issue.getResolution() != null

issue.getResolutionID() != null

 

 

7 answers

0 votes
Steve Bland June 20, 2019

Ilya

 

figured it out, this worked, was certain I had tried it before, more than once, which is when I went to the more scripted mechanisms instead of the simple Permission Validator, which was working for other datatypes we were validating

{Resolution} == "Unresolved"

 

I appreciate your time and effort to  give me a hand

Enjoy your day

 

Steve

Steve Bland June 20, 2019

Sorry that was universal validator not Permission

0 votes
Ilya Turov
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.
June 19, 2019

I'd suggest you then to try these two steps:

1. make sure the resolution of issue you are trying to transition is null (execute in SR console):

import com.atlassian.jira.component.ComponentAccessor
def issue = ComponentAccessor.issueManager.getIssueObject("KEY-123")
issue.resolution

2. try simply putting false in "simple validator" to be sure its' functionality isn't the issue here

0 votes
Steve Bland June 19, 2019

Thanks Ilya

 

Actually have tried both without success

0 votes
Ilya Turov
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.
June 19, 2019

the main question is: where are you trying to put this piece of code?

if it's scriptrunner's validator, then make sure it's a "simple scripted" one, not a "custom", because in the latter you need to throw exception yourself

0 votes
Steve Bland June 19, 2019

In fact with just issue.getResolution() you get a non descriptive error, that log nothing

"It seems that you have tried to perform an illegal workflow operation."

But at least it did not allow the suer to proceed

Ilya Turov
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.
June 19, 2019

wait, it actually means that validator worked, what else did you expect?

0 votes
Steve Bland June 19, 2019

Thanks, I had tried that and variations of it, but regrettably, it does not work

Jira indicates the issue as "Unresolved" in the UI, which to my understanding is that there is no resolution, null

 

so the validator should stop and indicate a problem, but it does not, it accepts the Unresolved resolution

0 votes
Nic Brough -Adaptavist-
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.
June 19, 2019

You should be able to test for "anything" by just using the phrase without comparison:

issue.getResolution()

If resolution is empty, this equates to false, and if resolution has any value, it's true.  So to get your query, !issue.getResolution() should invert it.

Suggest an answer

Log in or Sign up to answer