Can I used Automation for Jira to create a linked issue in another project

Kimi Nakashima October 23, 2019

We are using Jira Service Desk Cloud. We have a client that required their own JSD project for privacy reasons. So we created them their own project, but we'd really like to work out of one project. 

Is it possible to use Automation for Jira to create a linked issue in our main project when an issue is created in our client project? Then create another automation to transition the client project issue once the issue in the main project closes? Sort of like creating subtasks on issue creation, except not in the same project.

2 answers

1 accepted

3 votes
Answer accepted
Victor Seger
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.
October 24, 2019

Hi Kimi,

I'm Victor from Automation for JIRA Support Team.

Yes, It is possible to create a linked issue in different projects and also it is possible to transition an issue based on another issue transition. I've wrote some basic solutions for both of your use cases, it might need you to change some configurations.

Rule for creating linked issues in different projects:

Screen Shot 2019-10-24 at 10.54.36.png

In my example, the project CSDP is the customer project and ISD is my project. Please have in mind that you need to have the same issue type and issue fields on both projects.

Also, on the "Link issue" action, you need to be careful when selecting the "Link type" in order to ensure that it is used only by this rule as we are going to use the link type to determine which issues are going to be transitioned on the transition rule.

Screen Shot 2019-10-24 at 10.59.27.png

 

Rule for transitioning linked issues in different projects:

Screen Shot 2019-10-24 at 11.04.02.png

 

As you can see, we are using a branch for linked issues that only uses the "Clones" link type, that was the link type used on the first rule for linking both issues.

And in my example, I have the same status on both projects that's why I can use "Copy from Trigger issue" option under "Transition issue" action:

Screen Shot 2019-10-24 at 11.06.11.png

Also, notice that I've set the "Resolution" field using the "Choose fields to set..." option under the "Transition issue" action, as it is a required field for my issues.

Other general thing that you might need to have in mind while configuring those rules, is to keep the "Issue fields condition" to control when the rule executes its actions.

Hope it helps!

Please let me know if you got any further questions.

Cheers,

Victor (Automation for JIRA)

Kimi Nakashima October 24, 2019

Hi Victor,

Does the issue that the rule creates in the ISD project have to be cloned? It's not a problem if it does, but I'm just trying to see how far I can take this for future reference. For example would it be possible to create 2 issues in ISD when 1 is created in CSDP? Or would it be better to create subtasks for the issue in CSDP, convert the subtasks into issues, then create clones of the converted issues in ISD? Of course, I may be over complicating things.

There's one other thing, we have an existing rule in our project that I'm hoping this rule will not interfere with. I'll use your example project names to explain.

The issue that will be cloned from the CSDP project has an issue type of Service Request. In the ISD project there is also an issue type of Service Request. Both of these share the same fields. But we have a rule in the ISD project that creates 3 subtasks when an Service Request issue is created. I'm hoping that this rule will still run even though the issue is being cloned from a different project.

Best Regards,

Kimi Nakashima

Victor Seger
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.
October 25, 2019

Hi Kimi,

Thank you very much for your reply and all of your new questions regarding this. It is always good to explain things better.

About cloning and creating new issues:

I've only used the "Clone issue" action, as it will set almost every field in ISD issue as the CSDP issue without us needing to set everything manually. 

But, of course you can create 2 issues in ISD when 1 issue is created in CSDP, as you can see below:

Screen Shot 2019-10-25 at 08.06.55.png

Please notice that we needed to add two link actions after every "Create issue" action, just to keep those ISD issues linked to the original CSDP issue.

Also, if you want to keep the fields with the same value on the newly created issues, you might need to manually select on the "Create Issue" action the option "Copy from Trigger Issue" on those fields, as you can see below, as an example:

Screen Shot 2019-10-25 at 08.15.21.png

I'd suggest you creating those as subtasks and converting them to issues as it will be fairly more complex than just creating those issues.

Now, about the other rule you've mentioned:

I've understood that you want it to be triggered from the rule I've described you previously. Like, whenever an issue is cloned (even if by a rule), you want it to be triggered. Is that correct?

If it is, you can simply select the following checkbox on your "Rule Details" to make this possible:

Screen Shot 2019-10-25 at 08.26.26.png

By doing that, you're just saying that your rule can be triggered by another rule. 

But please let me know if this is not what you wanted on your description.

Hope that this information helps you.

Feel free to ask any further question you might have.

Cheers,

Victor

Kimi Nakashima October 25, 2019

Hi Victor,

I'm assuming that the 'Allow rule trigger' is a way to set a rule run order. But what if you have more than 2 rules that are all triggered on an issue's creation. How does Automation figure out the order to run them. Or does it just run them in a random order?

I'm asking because now I'm being asked to write a rule to auto-fill in some fields depending on the request type in project CSDP. This would need to be done before cloning the issue into project ISD. Then the issue in ISD would need to trigger another rule that would create 3 sub-tasks.

Best Regards,

Kimi Nakashima

Victor Seger
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.
October 28, 2019

Hi Kimi, 

Actually, it is not possible to set the rule execution order. And we have a feature request for tracking this (https://codebarrel.atlassian.net/browse/AUT-534).

With the "Allow rule trigger" checkbox you'll be just allowing an action inside of a rule to be the trigger of another rule (depending on the trigger configured). So, if you have a lot of rules with the same action and another rule with that action as a trigger, it will triggers everytime that action is performed.

For the scenario you've described, you might have some options of configuring those rules differently. Something like: 

- First rule (auto-fill fields): 

      - Trigger: Issue created;

      - Condition: Request type;

      - Action: Fields edited;

 

- Second rule (cloning issue) with "Allow rule trigger" checkbox enabled:

      - Trigger: Field value changed trigger with the "Issue created" action selected;

      - Action: Clone issue.

 

With this rule configuration you'll be ensuring that the fields are being set before the issue is cloned.

Another option would be for this to be done on the same rule, but that might be tricky to configure depending on the conditions you want to have.

Hope that it helps!

Let me know if you got any further question.

Cheers,

Victor

0 votes
Kimi Nakashima October 31, 2019

Hi Victor! 

It took a bit of trial and error, but I managed to modify the rules you laid out for me and I got them to work! But I had a few questions about transitioning linked issues.

Do you have to create a rule for every status change you want your linked issues to go through? For example, if your workflow has 3 statuses: In Progess, Pending and Closed, would you need to create 3 rules if you wanted both of your linked issues to transition together?

Best Regards,

Kimi

Victor Seger
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.
November 1, 2019

Hi Kimi,

Glad to know it worked fine for your rules!

About your question:

You can actually set the "Transition Action" to "Copy from trigger issue", as you can see below:

Capturar.PNG

Please notice that I've added 3 statuses to my rule trigger ("In Progress", "Backlog" and "Done") and the same rule will be triggered whenever a transition happens for any of these statuses. 

And when this happens, the linked issues will be transitioned to the same status as the trigger issue. 

You just have to ensure that your linked issues have the same status and a valid transition to that status on them. 

Hope it helps!

Cheers,

Victor

Kimi Nakashima November 4, 2019

Hi Victor!

The transition worked, but only if I kept it simple. So I can get an issue from one project to clone into another project and I can get the transitions to transfer between the projects as well. But I tried to make it a step more complicated and added sub-tasks in. 

Basically the steps are as follows:

1) Create issue in CSDP

2) Clone that issue in ISD (Clone rule)

3) Create 3 sub-tasks from cloned issue in ISD (Create sub-task rule)

4) When 3 sub-tasks are closed, cloned issue in ISD is transitioned to In Use (Transition parent rule)

5) Original issue in CSDP should be transitioned to In Use (Transition original issue rule)

Everything works, except for the transition of the original issue. If I turn off the sub-task rules, the original issue transitions seconds after the cloned issue.

When I looked at the audit log for the transition original issue rule, the sub-tasks trigger the rule, but the cloned issue (their parent) does not. 

I'm guessing that when you use a rule to transition an issue that it doesn't create a transition event? So the reason why my cloned issue doesn't trigger the rule is because the automation doesn't see it as having transition?

Am I off base? I would send screenshots, but honestly I don't know what screenshots would make this easier to understand.

Victor Seger
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.
November 6, 2019

Hi Kimi,

I'll be very glad to keep helping you with your scenario.

But as it is becoming so specific, I'd suggest you to raise an issue on our support portal (https://codebarrel.atlassian.net/servicedesk/customer/portal/1).

That way, we can guarantee that your scenario is well handled by our support team. 

Thank you in advance!

Cheers,

Victor

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events