On specific transition, I would like to copy all issue links of specific type to a custom field (copy summary + key of linked issues into custom field).
It would be used for user to acknowledge/accept current state issue links (in this case it's for "inventory" project - user would acknowledge all SW installed in his PC, which is done by connecting issue for his HW with issues for SW licenses)
Would this possible via ScripRunner?
Thank you
Hi Nikola,
It can be done very easily using "Read fields from linked issues or subtask" post-function provided by JIRA Workflow Toolbox.
You should use a configuration similar to this one:
conf-1.png
conf-2.png
conf-3.png
Configuration shown copies the fields Summary and Issue key of all Bug, New Feature and Task issues linked to current one with "is blocked by", "is cloned by" or "is duplicated by" issue link types into current issue's "Long Text" custom field.
Pairs Summary - Issue key are separated by comma character. An example of the value obtained at "Long Text" custom field might be:
Printer not working - CRM-34, Feature for uploading files - CRM-23, Compatibility with IE11 - CRM-54
Please, let me know whether this meets your requirements or not. I'm pretty sure I can implement your requirements using JIRA Workflow Toolbox.
Regards,
Fidel
Tried it, it works.
Sir, I think you have a new customer (if I'll get budget approval for it) I was looking at Workflow Toolbox for a long time and this was the final weights on the scale.
Just one quick question - is it possible to put between the values in result line breaks instead of commas? It would be better arranged this way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Nikola. I wish you become a user of JIRA Workflow Toolbox. I'm sure you will find many uses for it in your workflows.
I explain you how to replace comma separator with a new line character:
1) Select Ephemeral string 1 in parameter target field of "Read fields from linked issues or subtask" post-function, instead of Long Text custom field.
2) Insert "Copy a parsed text to a field" post-function after "Read fields from linked issues or subtask" post-function with the following configuration:
replaceAll(%{00061}, ",(?=(\\s.+\\s-\\s[A-Z]+-[0-9]+(,|$)))", "\\n")
Explanation:
What we have done is to store temporarily the initial value obtained from "Read fields from linked issues or subtask" post-function into auxiliary field "Ephemeral string 1", and then we store its content in the definitive custom field (in the example "Long Text" custom field), after having replaced the commas after issue keys with line breaks (i.e., \n characters). to do it we use function replaceAll().
We use a complex regular expression instead of simply a comma character (,), because we might have commas within the summaries that we shouldn't replace with line breaks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, thanks for the answer, unfortunately something is wrong. The parsed text is inserted in the target field but the replaceAll doesn't replaced the comma with line break.
See the pictures of the setup and result after the transition that used it.
toolbox 0.png
toolbox 1.png
toolbox 2.png
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.