Forums

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

Using the automation - how can I copy comment from the tiger issue to anther one

Samuel Bar
Contributor
October 13, 2023

Hi, 
Using a form in a Work Management project, I create an issue when the form is submitted.

I would like to copy the comment added to this issue to an existing issue in the project.

The trigger of the automation will be "Issue Created."
I am using a custom field(Select list (single choice)) in the Form and in the issues in the project.
The user submitting the form will select a value from in this custom field, and then I need to search for an existing issue in the project with the same value selected.
Then, I need to copy the comment from the created issue to the existing one and link the created one to the existing one.

It's a bit complicated, but hopefully can be done.

Thanks

1 answer

1 accepted

0 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.
October 13, 2023

Hi @Samuel Bar 

That does sound possible.  What have you done thus far to solve this need?

If you have started a rule and it is not working as expected...Please post an image of the complete rule, images of the relevant actions, an image of the audit log details showing the rule execution, and explain what is not working as expected.

If you have not yet started the rule, please note that using automation rules requires learning and experimentation.  To get you started on creating your rule, please refer to these documentation and example sources: 

Kind regards,
Bill

Samuel Bar
Contributor
October 14, 2023

Hi, I am familiar with automation.
I would appreciate it if a sample of this complex rule could be shared.

 

Thanks

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.
October 14, 2023

If you break the rule down into pieces, as you have already described, the rule is not too difficult.  The only piece you have not yet accounted for is using the Re-fetch Issue action in some key places.

  • trigger: issue created
  • action: re-fetch issue (to force a data reload before proceeding)
  • branch: on JQL using the custom field from the trigger issue to find the other issue
    • action: comment on issue, copying from the trigger issue
    • action: re-fetch the issue
    • action: link it to the trigger issue

Perhaps the only other thing to consider is: how many issues do you expect to match, and what do you want to do if there is more than one?  As shown above, the rule would handle multiple matches.

Samuel Bar
Contributor
October 15, 2023

Hi @Bill Sheboy ,

Many thanks for your time and help.

I will follow your guides.
There will be only one matching the search JQL.

 

Thanks

Samuel Bar
Contributor
October 18, 2023

Hi @Bill Sheboy ,

I will need your assistances again if passible.

This is my Automation so far

image.png

 

Error in Audit Log


image.png

 

Many thanks in advance for your time and help

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.
October 18, 2023

Reviewing that error message, we can see that the values in your Lecture List field have embedded spaces, such as for "lecture 2".

And so the JQL for the branch needs to have quotation marks around the smart value to handle that:

project = "Magic Open University"
AND issueType = Lecture
AND key != {{issue.key}}
AND "Lecture List[Dropdown]" = "{{issue.customfield_10914}}"
Samuel Bar
Contributor
October 22, 2023

Hi @Bill Sheboy ,

Many thanks for your time and effort.

Now it's working as expected!!

 

Thanks,

Samuel Bar

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events