Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I get keys of linked issues to custom field via automation

Petr A March 12, 2021

Hi there!

Spent a lot of hours looking for a solution, but still can't figure it out.

How can I get the keys of linked issues and put them in the custom field?

I tried to do automation with one request, which is executed every day. It works well if there is one related task. If there are several of them, the second task overwrites the field with its key. For example, I took two tasks at once in the request.

1.png

If I use lookup, then it finds all the tasks in the project, but tries to write them all in one field, which is wrong.

 

2.png

I am sure that the solution is somewhere close, but I cannot find it yet.
I would be very grateful if someone could help.

2 answers

1 accepted

2 votes
Answer accepted
nmenere
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 15, 2021

Hi Petr,

What issue keys are you trying display? In your example you branching on all cloned issues. Are you then trying to populate the field with all the linked issues of the original issue?

If that is the case, you should be able to use something like in the Edit issue action (no need to use advanced):

{{issue.issuelinks.outwardIssue.key}}

Though this doesn't filter by link type.

Hope that helps:

Cheers,

Nick

Petr A March 16, 2021

@nmenere Hi !
You are the best:D
I spent so much time looking for a solution, and it turned out to be one smart value.
Thanks a lot!! 
Tell me pls if there are such smart values, where can I see them?

nmenere
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 16, 2021

Ultimately we want to build a smart-values builder/autocomplete but at the moment we rely on documentation - https://support.atlassian.com/jira-software-cloud/docs/advance-your-rules-with-smart-values/

Like Petr A likes this
0 votes
Juan Manuel Ibarra
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 Leaders.
March 12, 2021

Hi! Petr,

You can use smart values in the text field in this case you are already in the linked issue barch so {{issue.key}} give you the key of the issue you are editing and {{triggerIssue.key}} the key of the issue thats trigger the rule.

Captura de Pantalla 2021-03-12 a la(s) 09.39.12.png

Petr A March 12, 2021

@Juan Manuel Ibarra Hi!

Yes, I use them, but one value overwrites another. This is the whole problem.

3.png

I need two values: TAS-401 TAS-437, but every times I get 401 or 437 :( 

Juan Manuel Ibarra
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 Leaders.
March 12, 2021

Perfect now I understand your problem, to append info instead of overwriting you need to use the advance field edition

 

This allow you to use the "add" command:

 

{
  "update": {
    "customfield_XXXXX" : [
      {
        "add": {
          "name":"{{issue.comments.last.author.name}}"
        }
      }
    ]
  }
}
Petr A March 12, 2021

No way ...5.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events