automation for linked issues after a new card has been created
Asked by Andre de Castro:

Hi.  

I have an automation that creates a new card (B) when I change the status of a card (A). I need the new card (B) to have the same linked issues as the card (A). The cards are in different projects.

Any idea how I can do this?

Thank you in advance.


Answers:
author: Andre de Castro
body: ...


author: Fernando Eug?nio da Silva
body: [@Andre de Castro](/t5/user/viewprofilepage/user-id/4468945)

You need to add a lookupIssue action before to find issues related to the current issue before to create the new issue.

Your steps should be like this:

- Action \> LookupIssues \> JQL: **issue in linkedIssues({{triggerIssue.key}})**

This will get for your current (A) issue all issues related.

Save this value in a variable using: **{{lookupIssues.key}}**

This is the result of all issues related with your issue A

In the action for create Issue B, select the field Linked Issues and use the variable name or insert the smartvalue **{{lookupIssues.key}}** directly.

Example:

![Captura de tela 2024-08-30 205204.png](https://community.atlassian.com/t5/image/serverpage/image-id/344898iE504886112E4F57E/image-size/large?v=v2&px=999 "Captura de tela 2024-08-30 205204.png")

This should works fine for you

Any questions, let us know

comments: author: Andre de Castro
body: Hello, Fernando.  

I tried to follow your instructions but I think I did something wrong because I didn't get any results. The related issues from card (A) were not copied to card (B).  
No error appears in the log, only no item was found in the search with the lookupissue action.  
There are related issues on card (A).  
Card (A) is in Jira Product Discovery and card (B) must be created in Jira Software. This shouldn't be a problem, right?  
Do you have any suggestions as to what might have happened?  

![2024-09-02 16_57_08-Window.png](https://community.atlassian.com/t5/image/serverpage/image-id/345158i83303D14C984D32E/image-size/large?v=v2&px=999 "2024-09-02 16_57_08-Window.png")


author: Fernando Eug?nio da Silva
body: [@Andre de Castro](/t5/user/viewprofilepage/user-id/4468945) , sorry for my miscommunication

Your variable "**related** " should contains the smartvalue: **{{lookupIssues.key}}.**

Also, considering your rule should search for issues in different projects, make sure that your automation is a global one considering the both projects.

Please, update that and try again :)


author: Andre de Castro
body: Hi, Fernando.  
Actually, the problem is at this point because the automation doesn't find any items and the log shows this message: "No items were found in the search while setting the custom value."  
I think I'm still doing something wrong or our Jira isn't able to perform this function.  
Thank you.![2024-09-04 18_07_03-Jira.png](https://community.atlassian.com/t5/image/serverpage/image-id/345770i99E964E47C766B86/image-size/large?v=v2&px=999 "2024-09-04 18_07_03-Jira.png")


author: Fernando Eug?nio da Silva
body: [@Andre de Castro](/t5/user/viewprofilepage/user-id/4468945)

As you said that the cards are from different projects, have you changed the scope of automation rule for **Global** instead **single project?**


author: Andre de Castro
body: I understand that this is OK, because the cards are being created in the target project, but they don't take the linked issues from the source card.  
The automation runs correctly and only reports that no items have been found.


author: Fernando Eug?nio da Silva
body: Great [@Andre de Castro](/t5/user/viewprofilepage/user-id/4468945) !

If possible, please, click to **Accept Answer** to help others community users with the same question as you to find this answer more quickly!


Tags: cloud

jira-cloud