Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira automation question

Mary Mark October 12, 2023

Hi Atlassian Community,

Wondering if this is possible.

We have a source project A that contains issue: Stories and would like to move and clone to a selected project a user chooses such as: Project B, C, D

These are agile projects and they share similar templates with more or less the same fields.

We would like to on source Project A create a transition button in the workflow that allows a user to choose the project to move to, for example: Destination Project = B. Once the project is selected, then clone fields from Project A to Project B

The caveat is Project A contain fields that may not exist in other projects.

For example, Project A contains field called: Criteria and Description. Is it possible to concatenate these 2 fields Criteria + Description into the Description field in the destination project: B

Can this be achieved via Jira automation rules? Currently in the automation rule, I can only select 1 target / destination project only. 

I have attempted automation rule but the concatenation piece does not work. 

Please see screenshot attached.

Thanks

MaryClone1.jpg

 

Clone2.jpg

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Champion
October 12, 2023

Hello @Mary Mark 

If you want to Clone the issue into multiple projects you will have to add a Clone Issue action for each project to which you want to Clone the issue.

 

To concatenate two values into one field you will need to set the destination field using smart values.

This page shows functions that you can use in smart values for text fields. 

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/

Are the fields both text fields?

If so then you could try something like this:

Screenshot 2023-10-12 at 10.46.19 AM.pngScreenshot 2023-10-12 at 10.48.34 AM.png

{{triggerIssue.Acceptance Criteria.concat(triggerIssue.Description)}}

Mary Mark October 12, 2023

Hi Trudy, I tried that and the rule completed successfully, however on the cloned ticket I am getting the following:

Both Criteria and Description fields are multi-line text fields.

=====================================================

Action details:
This rule was configured with a project restriction. You can change this restriction in the 'Rule details' section. Only issues from the following projects or project types will be considered:
AAUS

Related issues condition

The following issues passed:
AAUS-51

Clone issue

Issues cloned successfully
AAS-42

Re-fetch issue data

Issue data re-fetched from server successfully.

Branch rule / related issues

No related issues could be found.
The new cloned ticket did not concatenate the 2 fields together into: Description field.
Please kindly advise.
Trudy Claspill
Community Champion
October 12, 2023

Ah, yes, sorry.

There are single-project scoped rules and multiple-project scoped rules.

With a single-project scoped rule you are allowed to Clone an issue into a different project, but you cannot then use or operate against the issues in that other project.

The rule needs to be changed to a multiple-project rule and each of the relevant projects added to the scope of the rule.

That can be done only by a full Jira Admin from the Settings > System > Global Automation page.

When the rule is made multiple-project scoped, thereafter only full Jira Admins will be able to modify the rule, also.

And in that state, the rule will also need a Condition after the trigger to check that the trigger issues is in the one source project you want to work against. Otherwise the trigger/rule will operate against issues in all the specified projects.

Mary Mark October 12, 2023

So the rule worked on the source issue ticket but not on the cloned ticket. In the above mentioned, I would like the concatenation to occur in the destination cloned ticket. 

 

Thank you. 

image.png

Trudy Claspill
Community Champion
October 12, 2023

You have changed the rule so that the Edit is no longer being applied to the "For: Linked Issues" branch. That was not part of the solution I described.

The Edit needs to remain contained within the "For: Linked Issues" branch.

The solution, with your original rule, is to change the rule scope.

Mary Mark October 12, 2023

Hi @Trudy Claspill 

Thank you for clarifying the rule scope for multiple projects.  

For the Edit, I must be doing something wrong.  I have this in the rule which is contained in the Linked Issues Branch but concatenation does not happen. 

Can you please advise what I am missing or doing incorrectly? 

Currently if I run the rule, there is no change to the destination/cloned ticket. 

Criteria and Description still remains the same. 

I'm looking for Criteria + Description to be concatenated into "Description field" in the destination ticket. 

Thanks,
Mary

image.png

Trudy Claspill
Community Champion
October 12, 2023

Please show the details of the Edit Issue step in the above rule.

Please show the Audit Log information for execution of the above rule.

Have you changed the scope of the above rule to be multiple-projects, as I described? The Edit will not work if the scope of the rule has not been changed. Please show use the Rule Details page to show us the scope of the above rule.

Mary Mark October 12, 2023

Hi @Trudy Claspill 

I am able to get it to work now after switching to multiple projects, which is done in the automation rule and adding the relevant destination projects in the scope. 

Back to the first initial question. can the automation rule be triggered via a workflow transition in the source project that is initiated by the user performing the move. 

For example in the source project A, when user selects a transition called: Move and Clone in the workflow. A screen will pop up to allow the user to choose from a selected list of projects (destination projects). From the list, if user chooses Project B, the automation rule will kick off and clone the fields from source project to target Project B. 

In the target destination ticket, the reporter will be updated to the user who performed the move and clone action. 

The workflow transition: "Move and Clone" will be available from all statuses in an agile workflow. At any status, a user can select the project to move to and clone fields from the source project to target project. 

Thank you,

Trudy Claspill
Community Champion
October 12, 2023

The short answer is a qualified "no", you can't get everything you want within the automation rule.

There is an Issue Transitioned trigger for Automation rules.

However...

1. The trigger can't be configured to recognize a self-reflecting transition. You would either

1a. need multiple rules with unique triggers for "issue transitioned from A to A", "issue transitioned from B to B", and so on, or

1b. after the trigger you need to determine if the status of the issue has actually remained the same.

2. the rule cannot present a screen to get user input.

2a. You would need to create a Workflow Transition screen to present a user with a selection field for selecting the destination project and then store their selection in the source issue. 

2b. Unfortunately it doesn't look like the Clone action can use a field value to specify the destination project.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events