Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

In Jira automation, how to 'inherit' fix version in Advanced?

Niklas Malmberg
Contributor
March 30, 2023

Hello,

I want to create an Jira automation rule that will propagate down fix version information from parent to child, for example from Story to Subtasks. At the same time, I want to copy down labels from parent to child as well. 

In my example, I have these definitions in the Story:

"Fix versions" = ["8.2", "8.x"] (two strings)

"Labels" = ["hello", "goodbye"] (two strings)

I have read several posts which looks very similar to my case, like https://community.atlassian.com/t5/Jira-questions/How-to-make-sub-task-in-a-story-or-task-inherit-fix-versions/qaq-p/2109235

Unfortunately, there where not enough for me to understand how I should solve my problem, however similar it looked :(

I know how to set up the rule trigger I want, I can branch out over the subtasks correctly, but I'm having difficulties how to to do the assignment of the field/array. (I believe this perhaps has to do with fix versions being a multi-value field)

Questions:

1. Why is there no 'copy from trigger issue' option in Edit issue, like there already exists for labels field? (this helped my propagate down Labels information, half the task solved).
Skärmbild 2023-03-30 195916.png

2. Since the easy assignment was not enaugh, I had to go to Advanced. Here, should "update" + "add" be used, or "fields"?

3. Since the target field is an array, can it be addressed by the name "Fix versions" anyway? (I found no other allowed syntax, but ...)

4. Since the source field is also an array (the parents information in field 'Fix versions'), how should it be referred to? 

5. I've seen several different ways to access an array and also to transform the content, asJsonString, asJsonStringArray etc. Do I need to transform the content of the source data at all, when I really just want to copy (or add) the whole source field (whole array content) into the target array? 

 

What I currently have tested (which fails with JSON error, as shown in audit log for automation) is this code snippet:

Skärmbild 2023-03-30 200919.png

I hope someone here can help me understand what I'm doing wrong.

Thanks in advance
//Niklas

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
May 22, 2018

No.  It's fine to run a project without any priority on the issues.  It won't cause you problems in the future, unless there's some radical change in Jira (and then I'd expect the upgrade path to include code to set it to a default)

You should be able to search for issues though.  "Priority is empty" should return all the ones with no priority.

Suggest an answer

Log in or Sign up to answer