I'm following the guide here so that a comment can be added to linked issues when parent issue is transitioned, but my linked issues are not updating.
I have Project A with issue type "Test". The status "Done" has a transition screen that requires the user to add a linked issue (works fine in Behaviors), now after transition, the post-function doesn't add a comment to any linked issues via "relates to". I have scriptrunner version 7.9.0.
Steps to Reproduce:
Expected Results:
Actual Results:
I have found a workaround. Since it was not working in the workflow's Post Function, I opt for creating a Custom Listener and set Event as Generic Event
Custom listener script here:
Hi everyone!
How could I pass the URL of the current issue via comment using this Post Function? Example, if I want to pass the person responsible, I use currentUser.name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Diana Gorv
From your description, this doesn't seem to be a problem with ScriptRunner but an error in your configuration.
To proceed, could you please clarify which relates to option did you select?
As shown in the screenshot below, there are two options you can pick from:-
The objective is for the relates to work one way in any one Post-Function configuration.
If you select the first, it may work if the Test issue type transitions. Accordingly, if you are to select the second, it may work when the Bug issue type transitions.
However, if you want it to work when either the Test issue type transitions or the Bug issue type transitions, you will need to configure 2 separate Post-Functions for them; each Post-Function will need to be set to either one of the issue link types accordingly.
I hope this helps to answer your question. :-)
I am looking forward to your feedback.
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ram Kumar Aravindakshan _Adaptavist_ Thank you for the quick response.
I selected the first "relates to", since this post-function is on the "Test" workflow and the intent is for when "Test" issue type transitions to Done only. So a "Bug" issue type can remain in whatever workflow status is on. The idea is, when "Test" is Done, a comment will be added to linked "Bug".
I actually tested using other link names, not just "relates to", and nothing seems to trigger to add a comment to the linked "Bug".
I have also tested by adding the linked "Bug" before transitioning the "Test" issue to Done, because I thought perhaps order of post-functions was incorrect, but still nothing.
Is it possible because they are under 2 different projects, it will not trigger?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Diana Gorv
Can you show us screenshot of list of postfunctions on transition?
At first thought, looks like, that the order of posfunctions is not correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Evgenii Thank you for the quick response.
Unfortunately, I cannot share screenshots due to security, but I can type it out. I have it as:
I have tried also having 1 at the bottom, but still no luck.
This "Test" issue type is under Project A that doesn't have any custom listeners mapped to it, and same for "Bug" issue type under Project B.
I do have a transition screen for "Test" when moving to Done that makes the users input a linked issue. However, I have also tried having the "Bug" linked to "Test" before I transition as well, and still the "Bug" does not get an added comment after "Test" moved to Done.
Is it possible that a custom listener might solve this instead of using post-function?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Evgenii @Ram Kumar Aravindakshan _Adaptavist_
I have tried cycling through my custom Post Function through all the order of postfunctions 1-7, and nothing is setting the comment in my linked issue.
I have also tried testing with the same project key, and tried using all the different link types. It is not working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Diana Gorv
Maybe, as a workaround, you can use Jira Automation?
You can set trigger to "Issue Transitioned", select Statuses "From", "To", then select conditions, to check, that issue type = Bug.
And then select all linked issues and add there comments "This bug was tested in {{triggerIssue.key}}
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.