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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can I link issues with Automation for JIRA when I create a new issue?

What would I write in the Advanced section if I wanted to create links? 

For example: 

When issue X has a certain update, create issue Y and link them. 

Issue X relates to Issue Y.

thanks!

7 answers

1 accepted

So there's two ways to achieve this.  The easiest way is to simply add the "Linked issues" field to your create issue action like this and link to the 'Trigger issue':

link-created.png

This requires that the linked issues field is on your create issue screen though!

 

You can also achieve this with the separate 'Link issue' action but it requires branching off (using the 'Branch rule / Related issues action') for the created issue:

link-related-created.png

One caveat with this approach is that if this is a project specific rule (which you can see in 'Rule details') and the created issue is another project then this wont work.  You'll have to change this rule to a 'Global' rule via the 'Automation rules' section in global admin first so that the 'related issues' branch action can find the created issue in a different project.

Find out more about Automation for JIRA on marketplace, or visit our component docs: http://codebarrel.io/available-rule-components

I tried this but am getting an error in the automation log.

 

  Error creating issue
No issue link type with name 'relates to' found.

 

The type of link I want to do is "relates to" and linking is available on the create issue screen. I made a minor change to the code to reflect that:

{"update": {
        "issuelinks": [                   
            {
                "add": {
                    "type": {
                        "name""relates to"
                    },
                    "outwardIssue": {
                        "key""{{issue.key}}"
                    }
                }
            }
        ]
    }
}

 

 

Screen Shot 2016-09-14 at 8.59.31 AM.png

 

 

TIA!

I figured it out, after some coffee and chocolate smile

Our issue link type is called Related.

 

Hi Phyllis, 

Glad to hear you worked it out. Many things are solved with coffee and chocolate (only dark chocolate though I hope smile)!

Yes I should have made that more clear in my answer.  To get the issue link name, you need to check what they are called in your instance by visiting https://<yourinstance>/secure/admin/ViewLinkTypes!default.jspa (if you are a global admin).

Cheers,
  Andreas 

Like Maksym Ivanchenko likes this

Hello Andreas,

I am very sorry,  I am not familiar with the configuration of Jira. How should I configure it to let the linked issues field on my create issue screen?

 

Sincerely

Qing

You should add this little statement from the blog to all your documentation: 

Just make sure the “Link issues” field is on the appropriate screen in JIRA!

This was causing me havoc till I finally found this.

I have the "linked issues" field in the Create issues screen.  I have a rule set up to trigger once a story is created in a specific project to a specific Scrum Team....then Create a task...then link the task to the trigger issue.  Everything works up to the creation of the new task...but the new task will not link to the parent.

Basically once a story is created under specified conditions

new task is generated

and a link "Child of" is set to Trigger issue.

 

This doesn't seem to work.  Any suggestions??

Hey Brett,

Can you raise a support request please at https://codebarrel.io/support and include screenshots of your rule configuration and audit log (with show more expanded) please?

Cheers,

  Andreas

 

Andreas,

I would like to use “Automation for JIRA” with the following behaviour:

“Link any issue if it is mentioned on a comment of any other issue” (using a particular type of relationship).

It is possible?

Kind regards,

 

Marcos

Like Brad _ATS_ likes this

Hello,

 

I'm new to Jira and I have created set of rules to add a comment to the Service Desk ticket once we transition one of the software tickets. My problem is that I want to add the software ticket name into the comment. Is there a way to automate that in Jira?

Hey Mohammed,

 

what you meant with " software ticket name"? Summary or what?

Hello,

 

I can successfully create and link the new issue, but im having some trouble pulling across some of our custom fields that contain insight objects.

 

Capture.PNG

When I check the new issue created, the data doesn't exist. I can edit the issue and then add them all in manually but it doesnt seem the copy works.

 

Thanks

 

Phil

Hi, I think I have a similar problem. When an Issue's status is changed to Done I use Automation to Clone the Issue and transition it to Backlog. However I need all the Sub-Tasks of the Issue to also be cloned and transitioned to Backlog. How would you set up this rule?

 

Clone Issue > Transition to Backlog > Branch: Subtasks > Link Issue??

 

So far I keep ending up with two clones of the parent issue in Backlog of trigger issue and no sub-tasks.

the rule in the picture produces, for a non-null triggerIssue and a non-empty Driver (user picker) the following description:

RulareTeste pt: 
TESTS IN PROGRESS status instrumentat de un child- (=belongs-to) task in Daily. 
and triggerissue is

and triggerissue.fields.driver e:

triggerIssue info needed.JPG

 

Any help is appreciated, thanks!

Pompi

Hi Pompi,


Looking at your screenshot, it looks like you are using 'triggerissue'.  This is case sensitive though. It needs to be:

triggerIssue

Hope that helps.  Also to set a user field like 'Tester', you'll need:

{{triggerIssue.fields.Tester.name}}

 

Cheers,

  Andreas

Like Dan Bish likes this

That workded like a charm. Thank you. (it would be nice to have it emphasized that curly language , at least as variable names goes, is in fact case sensitive. I was under the impression , after reading the couple doc pages, taht smart fields are case insensitive - could be just my lack of attention though). Thanks again for the prompt response.

Hi Andreas,.

Is there a guarantee that the trigger issue is available in scope via smart values, e.g., {{triggerIssue.fields.MyCustomTextField}}? I am having troubles squeezing any sort of info from the issue triggering the rule once I find myself deep down covered under a branch rule like "For all linked issues". The values there, for both {{triggerIssue}} and {{triggerIssue.fields.MyCustomTextField}} are null (empty string if tried to be dereferenced in, say, Description or Assignee box). 

Hi Arici,

 

That should definitely work. 'triggerIssue' is always defined to be the issue introduced by the rule trigger.

Can you raise a support request please at: https://codebarrel.io/support

Please include a screenshot of your rule configuration and audit log showing a rule execution.

Cheers,

  Andreas

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍂📹 Apptoberfest demo contest roundup: vote for your favorite demos!

Hi Community! The submissions are in (and listed below) for the 🍻🍂Apptoberfest🍂🍻 Demo Competition and it’s time for you to place your votes for the best: Analytics & reporting app demo ...

79 views 2 11
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you