I am using the post function built in script "Fast-track transition an issue" but things don't seems to be working fine -
I haven't given any condition so it should work and the transition is taking place in the backgroud i.e. on UI I don't see the new status, it's still the name and icon of the old status but the transition buttons on the UI are in sync with the fact as if the transition has actually taken place.
Also I am trying to set comment and resolution but thats also not working -
This post function is on the create transition and I am using JIRA 5.2.11.
Hi @henning, Thanks, putting it in the end worked.
But still I am not able to update the resolution or description, this is the code snippet I have added in the "Additional Code" Section
issueInputParameters.setDescription("I am a description");
Technically it has to be after the reindex because otherwise the reindex could take place after the fast track transition but with the issue data before the transition.
Try to add issueInputParameters.setSkipScreenCheck(true) to the additional code, maybe your transition screen doesn't contain description and resolution fields?
First of all, thanks for sharing this fact regardin- if the fields aren't on screen then we have to use skipScreenCheck. I didn't know this fact as it isn't written on the script runner page where fast track transition info is give. But even after adding it I can't seems to update the description or the resolution - here's the code snippet
log.setLevel(org.apache.log4j.Level.DEBUG); issue.setResolutionId('5'); issue.setDescription("I am a description"); issueInputParameters.setSkipScreenCheck(true); log.debug(issue.getDescription()) ;
I can see in the logs the o/p of log.debug printed as "I am a description" but on the actual issue the description which I enter "test" while creating the issue still persists.
In the above code I tried with both
issue.setResolutionId('5'); and issueInputParameters.setResolutionId('5');
Both don't seems to work. Shall I re-index my test instance?
Tarun, did you get this to work?
I've build a listener that I can't seem to get to work. I'm getting odd behavior, such as: Issue shows Open with a resolution of Completed/Fixed (but the History of the issue shows that it changed from Open->Closed and from blank->Completed/Fixed. Reindexing does not make it work.
Also, if I withold the setResolutionId, I get a Closed issue with an Unresolved resolution.
Finally, I have tried doing 2 listeners: 1 to handle the Resolve Issue action and the other to handle the Close Issue action. This scenario does not work either.
All I want is the Issue with a certain summary (my condition) to, upon creation, set resolution to Completed/Fixed (1), status to Closed (6) and add a comment saying it was automatically fast-tracked.
I think the steps that your doing are fine, but with script runner I have faced an issue which is if you do to many things, then it might show odd behaviour as it's a open-source plugin and some of the features might not be well tested for all scenarios.
As you have specified -
All I want is the Issue with a certain summary (my condition) to, upon creation, set resolution to Completed/Fixed (1), status to Closed (6) and add a comment saying it was automatically fast-tracked
I would suggest you to write a simple script in the post function to do all of the above instead of relying on fast tracking an issue. The Mutable issue API contains everything for setting commet / resolution and for the status part only and only use workflowutil other-wise data might get corrupted see here -
right way to perform issueoperations - IssueService-
I tried to do the same thing: adding a fast-track transition post function for transition from Create to New, leaving the condition empty so it's always true, and set action to 'Create(1)', add addtional code setComment. But nothing happened. I've already moved it to the end of all post functions. Do you know why?
I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG