Hello,
I want to be able to automatically populate the fix version in a ticket, where the fix version is sourced from the linked ticket.
Given I have Ticket 1A and I have a ticket linked to it, let's say Ticket 1B. Is it possible to automatically pull the Fix version from Ticket 1B and copy it on to Ticket 1A once it is filled out in Ticket 1B for example?
And if so, Is it possible to also pull from multiple linked tickets? Pull Fix Version/s from Ticket 1B, 1C, 1D, 1E and copy to Ticket 1A.
Thanks,
For Gonchik's "Option #4", this is the SIL script you would use. (Power Scripts for Jira must be installed).
/* This script will scan all issue links of a given
issue, grab the fixVersions of the linked issue, and
append those fixVersions to the given issue.
*/
string [] allLinkedIssues =linkedIssues(
key
);
for(string issue in allLinkedIssues) {
fixVersions = arraysConcat(fixVersions, %issue%.fixVersions);
}
You could then configure it so this script will pull in linked issue fixVersions on a workflow post-function or on an issue created / edited event listener. If you wanted to _push_ changes when a version is populated, it would be a little different.
/* This script will take the fixVersion/s of a given issue
and apply the same fixVersion/s to all linked issues.
*/
string [] allLinkedIssues =linkedIssues(
key
);
for(string issue in allLinkedIssues) {
%issue%.fixVersions = arraysConcat(%issue%.fixVersions, fixVersions);
}
You'd then probably trigger this script from an issue created / edited event.
Hope this helps!
Hello Justin, thanks for the reply!
Another issue is the linked issue would not have the fix version until later on in the workflow for the original ticket.
Would this script continually listen and pull in the fix version when it gets filled in in any of the linked tickets? Or only when the post function triggers this script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It sounds like you'd want to push the fixVersion changes out to all linked issues when the fixVersion field is modified. For this use case, you would use the second script above. You would then trigger the script on an "Issue Updated" event. Of course, you'd probably want to limit the scope of the script to a single project so it's not running for all projects. You could further limit by issue type or any other criteria.
if(project=="PROJ") {
string [] allLinkedIssues =linkedIssues(
key
);
for(string issue in allLinkedIssues) {
%issue%.fixVersions = arraysConcat(%issue%.fixVersions, fixVersions);
}
}
This will append the latest fixVersion to all linked issues of the issue that was updated. If you want to synchronize fixVersions instead of appending, you could replace line #4 with:
%issue%.fixVersions = fixVersions;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you again Justin! This clears up a lot of the logic behind it. I will try this method as well as the Scriptrunner Method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
it is possible.
1. You need write a grovyy script like this
How faster do you prefer? see fix version? (like listener you need it. or service)https://scriptrunner.adaptavist.com/4.3.5/jira/listeners.html#_add_watcher
2. Possible another solution: it will based on automation lite for jira
Just you need understand which direction of link is main, the create a jql function and create listener or service for copy fix version value from one issue to another.
3. Possible solution it will based on other plugin: please, read below
https://community.atlassian.com/t5/Jira-questions/Copy-field-from-parent-to-sub-task/qaq-p/391863
4. you can write a some SIL script
5. Possible solution it is JS script you can include it using this plugin
https://marketplace.atlassian.com/plugins/ru.mail.jira.plugins.jsincluder/server/overview
Cheers,
Gonchik Tsymzhitov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the prompt reply! Which option would require less development work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can start from 2 point,
from automation lite for jira plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you know how I am able to pull in Fix version/s from linked issue(s) using script runner? It would only pull in the fix version when the linked issue(s) has updated the fix version field. This would apply within 1 project, and one specfiic issue type. How would I go about doing this? @Nic Brough -Adaptavist-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.