How to immediately resolve issues upon creation

BarthélémyH April 10, 2012

Hello,

We have a use case where we use JIRA to log interventions done in our production system. Issues are usually created afterward.

We have a custom field "Immediate resolution" as a radio button (Yes, No). We installed Script Runner and tried to add a Fast-Track post function for the Create Issue transition. The condition we set is
cfValues['Immediate resolution']=='Yes'
and the action is "Resolve issue (5)".

It doesn't work :( the issue is not resolved upon creation.I am sure the name of the field is correct.

With an empty condition (true), it does work. However, the screen first shows the issue as if it was not resolved. After a refresh it shows the proper state.

What could be the problem with my condition ?
Is there another way of doing this ?

Thank you in advance for your help,

Barth

3 answers

1 accepted

1 vote
Answer accepted
JamieA
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 10, 2012

It's tricky doing the transition on the creation step, although it is tested and should work. JIRA 4.4.3 has a bug that could cause problems. What version of jira are you using?

Your condition is wrong for radio buttons, it should be (IIRC):

issue.cfValues['Immediate resolution'].value == 'Yes'

But use the condition tester admin script to fine-tune it.

That's not your problem anyway, if it doesn't work with no condition.

Are you using the additional code section to set a Resolution value? That could be why it's not happening. Check the logs, which will show if the transition validation failed.


JamieA
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 10, 2012

I didn't fully read your question properly. 1) your condition is wrong, which is why it works with an empty condition. 2) That page refresh thing - I have seen that recently and still battling with it. Basically the transaction happens in a separate thread to work around the jira 4.4.3 bug, but it has the side effect of not immediately showing the correct page when it comes back.

JamieA
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 10, 2012

Correction. I did read your question, but you changed it afterwards.

BarthélémyH April 10, 2012

I did read your question, but you changed it afterwards.

Hi, yes, sorry. I realized afterward that my message was wrong and edited it.

Thank you for your help on the condition. I will modify it.

What version of jira are you using?

I use JIRA v4.4.4#664-r167664. I will instruct people about the page not showing the proper status and wait until there is a solution to this problem.

Are you using the additional code section to set a Resolution value? That could be why it's not happening. Check the logs, which will show if the transition validation failed.

I don't use the additional code section.

Thank you very much for your extensive and very quick help. Best regards,

Barth

JamieA
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 10, 2012
JamieA
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 12, 2012

Yes, you will need to set the resolution.

BarthélémyH April 12, 2012

Hi again,

I don't know if it is related, but I have just noticed that the issues that are fast-tracked are resolved according to their status but their resolution is still "unresolved". I am going to force the resolution to resolved in the additional code section.

Cheers

BarthélémyH April 12, 2012

Hi,

I am trying to do so, but nothing works. The resolution stays to "unresolved". I tried the following

issue.setResolutionId('1')
issueInputParameters.setResolutionId('Fixed')
issueInputParameters.setResolutionId('1')

I noticed that actually the resolution doesn't exist yet if I do

log.debug issue.getResolution().getId()

in the additional code section. I get an error "Cannot invoke method getId() on null object".

I can make it by writing a script to execute after the transition "Resolve Issue" where I test my condition again and set the resolutionId to 1. Is it the way to do it ?

thank you ,

Barth

Özerk Dolanbay June 1, 2014

Hi Jamie,

Is there any progress on this issue https://studio.plugins.atlassian.com/browse/GRV-110

JamieA
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 2, 2014

@Barthélémy von Haller - bear with me, I will test this again.

Sheral Hewes January 27, 2015

Any work around for the refresh issue on GRV-110?

1 vote
Mizan
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 10, 2012

What happens when you move down your post function to the bottom (After issue created event is fired) ?

JamieA
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 10, 2012

Good point. From the docs:

Place this as the last post-function, or at least after the Fire Event function.
If you don't do this, it won't work.

BarthélémyH April 10, 2012

Thank you for your message. It is already the last post-function.

0 votes
B.J. Herbison October 17, 2013

Was there ever a resolution for this issue?

Suggest an answer

Log in or Sign up to answer