Hello there!
I have an issue and it has the parent link set. I want to retrieve a custom field value from the issue which is in the parent link. Basically I want to compare the two custom field values whether they are the same in the issue and the issue in the parent link.
My custom field is a single select dropdown field.
{{issue.parent link.customfield_xxxxx}} did not work.
I tried with other fields ( {{issue.parent link.assignee.displayName}} and {{issue.parent link.assignee}} ) they did not work either.
However {{issue.parent link}} gave back the key (with a link) of the issue in the parent link
My company is on datacenter 9.4.11 and we have ScriptRunner.
Thanks in advance!
Hi @Tóth Tamás -- Welcome to the Atlassian Community!
When an issue links to others (e.g., such as with Parent, Parent Link, or issue links), an automation rule does not necessarily load all of the data for those linked-to issues. If it did, you could imagine a scenario where a single issue connects to many others, perhaps all of them in the site!
The way to know what is available is by experimentation: create a test rule to access the field and write it to the audit log. If it is present, you may use it. If not...
The solution depends upon what you need to do, and as you describe using Jira Datacenter, the options are limited for automation rules:
For Jira Cloud, the other option is using the Lookup Issues action with JQL to access the field. That will not work for Jira Datacenter as most fields are not yet supported for that action: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877
Kind regards,
Bill
Hy Bill!
Actually I'm playing with this rule in a dev environment, and tested a lot, but I just ran out of ideas, and wondered if am I doing something wrong, or simply it is just not possible.
Fortunately I don't need to edit other issues based on the information, just a notification email would be more than enough (see the whole automation in my other reply).
By "use a branch rule" you mean creating a "branch rule / relating issues" component? Then which type of related issues should I choose (none of them seemed appropriate for the parent link)?
I have the following options: current issue, sub tasks, parent, stories (or other issues in epic), epic (parent), all created issues, most recently created issue, linked issues, destination issue, JQL, issues in fixed version, issues in sprint
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Without seeing your entire rule for context, you could use a branch on JQL to access the issue.
If that does not help, please post an image of your complete rule, and images of any relevant actions, to provide more context.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the full automation:
The third "Else-if: all match" part is the tricky one. If the epic is created, and the parent link is set, then I would like to retrieve issue's (which is set in the parent link) customfield.
{{issue.parent link}} works fine, returns the issue's key
{{issue.parent link.customfield_11801}} returns blank
As you just wrote in your first reply, maybe it is just not accessible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that information. It does appear you will need to branch to the parent first, however...Given the limitations of rules, an if / else condition cannot be placed inside of a branch.
One workaround for your scenario is to capture the parent field first, such as like this to compare the id of the selected value:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm afraid I don't have the create variable action since we are on data center, and as far as I know this feature was only implemented on cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The create variable action is available for Jira Cloud and Data Center versions of automation:
This action was added in August 2023 with version 9.0.0 - 9.0.1. Please check with your Jira Admin on your current version and if it needs to be updated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Indeed, you are right. I thought our JIRA core and Automation for JIRA plugins version numbers are the same, but it turned out they aren't. As you advised, we need to update it, and with the help of variables, I'm sure I will figure out a solution.
Thanks for all the replies and help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tóth Tamás
Welcome to the community.
Could you please provide your automation rule as well. This will help community members to understand the logic of the rule and help you the find a solution.
But I think you need to look from the parent to the linked issues and and then compare.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hy Marc!
Sure, here it is:
Basically what I want to achieve with this automation it to make sure colleagues follow the correct structure we implemented. We use advanced roadmaps so our hiearchy looks like this:
Business concept -> Increment -> Epic -> standard issue types -> sub issue type
We have a custom field called related project and we use this field to mark all the issues that belongs to a specific project and in all levels it should have the same value (e.g. if an increment belongs to "project x" than all the issue under it must belong to the same project). We use this field for a lot of other processes so it's important to set them properly but unfortunately people sometimes mess this field up thus breaking the structure.
With the automation I want to receive an email if on any level, the given customfield is not the same, as the element above it.
The first "IF" statement examines the created subtasks, whether it has the same customfield value as the element above it.
The second "IF" statement does the same, but for standard issues. It examines if the given issue has the same customfield value as epic above it.
And with the third "IF" statement came the problem, I could not retrieve the issue's customfield value which is set in the parent link.
According to this thread (How to access parent link issue's fields (atlassian.com)) at least retrieving the assignee should work, that is why I thought it should work with customfields too. Unfortunately neither of the worked for me.
And thanks for the recommandation, maybe I will create a separate automation which will examine the "higher" level's child issues and see if those work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tóth Tamás
What if you would set the last else condition to:
{{issue.Parent Link.customfield_11108}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately it just returns nothing.
I also tried these two variations:
{{issue.Parent Link.customfield_11108.value}}
{{issue.Parent Link.customfield_11108.data}}
still no success.
Anyway, it is not a big deal if I can't do (or can't be done) with automation, I can reach jira's DB so I will create a report based on that.
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.