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

Jira Automation - Creating a clone ticket from company-managed to team-managed

Abi Williams May 9, 2024

Hey everyone i was wondering if anyone can assist me with an issue.

We have two teams who are working on the same project. One team uses team-managed and the other team uses company-managed. We havent changed anything from default tickets (tasks, stories etc) minus one were it is called release deployment. I have changed a few of the columns but i am not sure

I am trying to create an automation where if something on company-managed is created under an parent (epic) it will be cloned onto the team-managed project using this logic below. This is coming from company-managed board.

Screenshot 2024-05-09 133226.png

Screenshot 2024-05-09 140158.png

I currently have a testing project (our old board) that is company-managed but every time i create it i get this error: " Can not create issue in project/issue type 10112/10014" I aint sure what this means at all because i aint getting enough info to understand what this means.

Screenshot 2024-05-09 134348.png

Any help would be grateful. I aint the biggest Jira expert so i will need info on how find things if you require additional info.

1 answer

1 accepted

3 votes
Answer accepted
Bill Sheboy
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.
May 9, 2024

Hi @Abi Williams -- Welcome to the Atlassian Community!

Team-managed projects (TMP) have their own configurations and types, different from the shared ones for company-managed projects (CMP).  That error indicates using the Issue Type of "Same issue type" will not work with the TMP, and so it shows the specific issue type id values which have the problem. 

Please try selecting the specific issue type from the dropdown list to see how that helps.

Kind regards,
Bill

Abi Williams May 10, 2024

Morning @Bill Sheboy

The company-managed project will use both stories, tasks and spikes for this project hence why i wanted to keep it as the "same issue type" because i figured it will copy over easier. 

I tried checking to to task as a test and go another failure. Apparently it didnt like the story points so i removed this too.

It now looks like this. 

Screenshot 2024-05-10 094510.png

And these were the errors:

Screenshot 2024-05-10 094242.png

Bill Sheboy
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.
May 10, 2024

Regarding story points:

  • company-managed projects use the "Story points" field, and
  • team-managed projects use "Story point estimate". 

Please select the correct field from the dropdown list for the TMP issue, supplying the value as {{issue.Story points}} to copy it.  However...

 

Regarding issue types, this is a known problem for cloning issues between TMP and another project...even two different TMPs: https://jira.atlassian.com/browse/AUTO-410  The defect is intermittent: in my test site, the Task issue type works but the Story one does not :^(

Two possible work-arounds to try:

  • Instead of Clone Issue, use the Create Issue action, manually selecting and copying each field.  This will require using an if / else structure on the trigger issue's type so the correct issue type may be selected explicitly in the Create Issue action.
  • Using the same if / else structure on issue type, except call the REST API create issue function with the Send Web Request action

 

Abi Williams May 10, 2024

Afternoon @Bill Sheboy 

TIL about story points. They don't specifically highlight it easier between team vs company-managed projects in regards to fields but it might be being picky!

AUTO-140 would explain the issue then. Thank you for finding this. 

I have figured out to do method 1 and it is working perfectly. Thank you very much! Only thing i am not sure about is how to do subtasks on tasks? Do you have any advice on how to do this?

Bill Sheboy
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.
May 10, 2024

Subtasks are challenging for cloning in rules, and one approach to try is:

  • after creating the new Task (i.e., the new parent), save the key {{createdIssue.key}} using the Create Variable action
  • branch to the trigger issue's subtasks
    • using the Create Issue action again, re-create each one, setting the parent to the saved key in the created variable

This method will not preserve the order of the subtasks from the source issue because branches which could be on more-than-one-thing are run in parallel and asynchronously.

 

Like Abi Williams likes this
Abi Williams May 10, 2024

Sorry do you have an example of this? Not entirely sure how to do this. I have created the variable but not sure how to branch to the trigger on the issues subtasks?

I am not worried about the order of sub-tasks as we will coordinate it between the teams but thank you for the additional info. 

Bill Sheboy
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.
May 10, 2024

Perhaps try extending your original rule, like this, with the changes in bold font:

  • trigger: issue created
  • action: re-fetch issue (I recommend adding this after the Issue Created trigger to prevent racetrack error / timing problems.)
  • condition...on the project
  • condition...on the parent key
  • action: create issue (to "clone" the trigger issue)
  • action: create variable
    • name: varCloneKey
    • value: {{createdIssue.key}}
  • branch: on subtasks
    • action: create issue, of type subtask to "clone" it, and setting the parent field to {{varCloneKey}}

 

Abi Williams May 13, 2024

I got this but i dont think it is right?Screenshot 2024-05-13 155517.png

Bill Sheboy
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.
May 13, 2024

The rule editor does not always make it easy to see what is possible :^)

In the Create Issue action for the parent field:

  • type in the smart value for your variable: {{subtaskvariable}}
  • it will appear below the field as you type
  • select it, and that will use it in the action for the parent

 

Abi Williams June 7, 2024

Hello @Bill Sheboy 

Sorry been super busy so i have been unable to do anything until now but i have reattempted this but it isnt working? Im pretty sure im doing something wrong but i cannot see my error. 

Screenshot 2024-06-07 161603.pngScreenshot 2024-06-07 161637.png

 

Bill Sheboy
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.
June 7, 2024

When cloning the subtask, please set the Parent field, not the Epic Link field, to that created variable for the newly cloned Task.

 

Abi Williams June 10, 2024

Tried again and got this error? 

 

Screenshot 2024-06-10 122245.pngScreenshot 2024-06-10 122301.pngScreenshot 2024-06-10 122411.png

Bill Sheboy
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.
June 10, 2024

I just tried again and creating a subtask with a parent specified by a variable still works.

Two things to check:

  • Before you try to create the issue, write that created variable to the audit log to confirm in contains what you expect
  • If it does not, please post an image of the Create Variable action where you create it to determine if the value and smart value are correct

 

Abi Williams June 10, 2024

I know it is something i am doing wrong but not entirely sure what.

Not sure how to write something to the audit log.

Here is the screenshot of the created variable.

Screenshot 2024-06-10 162151.png

 

 

Bill Sheboy
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.
June 10, 2024

The create variable action looks correct.

 

There is a log action which allows writing text to the log: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Log-action

If you write that variable to the log after it is created that may help.  Perhaps something like:

the clone key is: {{varCloneKey}}

If that shows as empty, something is wrong with where the variable is created

To check that, please post an image of your complete automation rule, in one single, continuous image.  To do that, you may need either a scrolling browser capture tool or browser addon.

 

 

Abi Williams June 11, 2024

I have noted another weird issue. Every time i create a task it doesnt copy onto the board. There will be some tasks without subtasks. Spike, bugs, stories etc are all working fine but not tasks on their own and tasks with subtasks. 

Update: just tried it on bugs and not working either. Something isnt right with the ordering i believe.

Untitled.pngScreenshot 2024-06-11 112235.png

Bill Sheboy
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.
June 11, 2024

If you compare the log to the rule steps, you will see the Task issue create is failing.

And so the created variable is empty as there was no issue created.

Please review the image of that action as I suspect it is trying to set the parent, but it should not for your scenario.  Setting the parent should only happen for the Subtask create in your scenario.

 

The log also shows that the trigger issue did not have any Subtasks and so the branch did not proceed.  Did you expect that?

Abi Williams June 11, 2024

I did note that but im not understanding why. The tasks are being created as i can see them on the board okay. I also attempted to create a bug and now that isnt working where it was working before i introduced sub-tasks.

For testing i created a task then add the subtasks afterwards so no i wasnt expecting that.

Bill Sheboy
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.
June 11, 2024

Given what you describe, I would expect that behavior for the branch:

  • your rule is triggered on issue created, and so starts soon after the Task is created...
  • but it runs so quickly the subtasks are not available yet when the branch is reached (as you are still adding them).

 

At this point, I recommend working with your Jira Site Admin and contacting Atlassian Support to take a look.  They may see something we are missing.

You appear to be on a paid Jira license, and so your admin can submit the ticket here: https://support.atlassian.com/contact/#/

 

Abi Williams June 12, 2024

Okay thank you very much for your help.

I will run the automation without subtasks so i got something but i will speak to Atlassian and see what can be done.

Suggest an answer

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

Atlassian Community Events