I have writte a post-functiion script which I am running with ScriptRunner. It clones an issue to a different project.
The script is triggered by the status change from "open" to "in progress". So far it works fine, the only strange problem is that in the list overview the status of the origin issue is displayed (even after browser refresh) with the status "open" while in the detail view the new status "in progress"is correctly displayed. The script as such works fine.
Anybody an idea what the reason could be?
Cheers,
Thomas
Thanks Henning. Moving the posftfunction past the reindex solved the problem.
Thanks for your explanation. I am creating a new issue in a different project For that I am only invoking getters on the origin issue.
The only place where the origin issue might be changed is the where I create the link which is linking the origin and the copied issue.
The code fragment is shown below:
IssueLinkService.AddIssueLinkValidationResult linkValidationResult = issueLinkService.validateAddIssueLinks(currentUserObj, issue, linkType.id, Direction.OUT, targetIssueList, false); if (linkValidationResult.isValid()) { issueLinkService.addIssueLinks(currentUserObj,linkValidationResult); }
Could that create that problem?
Btw, I cannot reproduce the problem on my local version 6.1.5. Unfornutately, I cannot upgrade the installlation where I have to run the script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your index has the wrong value for your origin issue. You have to make sure that you are using the provided issue object if you're making any changes to the origin issue. If you get a new issue object in the postfunction it's the old issue without the transition information. If you update the issue using this object you have an index problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your explanation.
I am creating a new issue in a different project. For that I only invoke getterrs on the origin issue.
The only place where the origin issue might be changed is where I create the link which linking the origin and the new issue.
IssueLinkService.AddIssueLinkValidationResult linkValidationResult = issueLinkService.validateAddIssueLinks(currentUserObj, issue, linkType.id, Direction.OUT, targetIssueList, false); if (linkValidationResult.isValid()) { issueLinkService.addIssueLinks(currentUserObj,linkValidationResult); }
Could create that problem?
Btw, I cannot reproduce that problem on my local Jira 6.1.5. Unfortunately, I cannot upgrade the target Jira to 6.1.5 right now.
Any further idea?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that could be the problem. In the JIRA source of version 6.0.7 the addIssueLinks() method calls issueManager.createIssueLink() only with the ID of the issue, which is then used to reindex a new issue object (which doesn't know about the changes).
Try to place your post function after the reindexing takes place could solve the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.