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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Creating an automation rule to Tag the previous assignee

Hi,

 

I am looking to create an automation rule that would tag (@) the previous assignee of the issue in a comment. To trigger this rule, the ticket must be "blocking" another ticket. This blocking rule is based on the out of the box issue link of blocks/blocked by.  

Example:

  • Ticket A blocks ticket B. 
  • Ticket B is currently unassigned. The previous assignee was John Smith
  • Ticket A is set to done
    • Automation rule is triggered
    • System comments on ticket B "@John Smith, the ticket blocking this ticket is now done"
    • Automation rule ends

Currently, I am able to do the following using automation:

  • Determine the previous assignee and comment their name but only in plain text, not as a shoutout(@)
  • Automate the tagging of a blank "user" that when clicked, takes me to an error screen

 

My comment log smart value is {{#changelog.status}}{{fromString}}{{/}}.

 

Any ideas?

 

thank you!

Dylan

1 answer

Hi @Dylan Brock,

To mention someone in the comment, the syntax is [~accountid:thePersonsIdNumber]. You have mentioned the following:

  • Determine the previous assignee and comment their name but only in plain text, not as a shoutout(@)

Can I know how you are getting this value?

Thanks,
Moga

Yep Moga has the solution here. To get the account id, you should be able to use:

{{#changelog.assignee}}{{from}}{{/}}

I just tried using {{#changelog.assignee}}, and it only worked if the assignee had changed as part of whatever triggered the rule. I don't see an assignment change in Dylan's original rule, so I too was wondering how they were able to get that value.

Hey All!

Thanks for the responses. I am realizing I pasted the wrong syntax above, so my apologies. I am using: 

[~assignee.accountId:{{#changelog.assignee}}{{accountId}}{{fromString}}{{/}}]

this produces the @ user which is a dead end when clicked. This is what I am trying to fix

I should be clear as well, I am NOT looking to tag a specific user ID, I am looking to parse the changelog to tag the previously assigned user.

 

@mogavenasan I was able to get the system to comment the previously assigned user by doing exactly what @Mark Chaimungkalanont  suggested:

{{#changelog.assignee}}{{fromString}}{{/}}

This did not require the assignee to change as part of the rule, however.

Hi all,

The reason why I was curious about how we are getting the previous assignee information is that according to Smart values - general:

Available properties

  • {{changelog.summary}} - Changelog information for the Summary field
  • {{changelog.issuetype}} - Changelog information for the Issue type field
  • {{changelog.status}} - Changelog information for the Status field.

I don't see the changelog.assignee here. 

If you edit the comment and view it in Text mode, do you see anything wrong with the content? Maybe we can reverse engineer this and see what we can do about it.

Like Darryl Lee likes this

Screen Shot 2021-01-25 at 12.53.18 PM.png

Here you can see the difference. The "user" is what the automation creates, the blue bubble is my manual add for context and to see the difference.

I agree, I noticed assignee was not shown as possible, but because I have been able to identify the previous user (though only as plain text) I had hoped it was possible to jig together. 

Hey Dylan - can you please send a screenshot of your rule? I've repeatedly been unable to get either the accountID or displayname of the Previous Assignee using any of the code you posted: 

{{#changelog.assignee}}{{fromString}}{{/}}

OR

{{#changelog.assignee}}{{from}}{{/}}

What I'm wondering is whether in fact, you're not actually getting that value at all.

The only way I was able to get the Previous assignee to show up in a Comment (or the log) was to add the Assignee field to the screen used in the Completed transition, and then change the assignee.

But at any rate, it looks like Automation is not properly interpreting Smart Values inside of the brackets, so the @ mention thing is not going to work regardless of whether we can figure out how to find Previous assignee for you.

Here's what I had in the rule to add a comment:

Previous assignee (changelog):
[~assignee.accountId:{{#changelog.assignee}}{{from}}{{/}}]

Username: {{#changelog.assignee}}{{fromString}}{{/}}
AccountId: {{#changelog.assignee}}{{from}}{{/}}

Blocking ticket is Completed

And here's the resulting comment:

auto.png

Moga, Mark: do you have any other ideas?

I believe the correct syntax to mention someone is [~accountid:thePersonsIdNumber]. Can you try the following:

Previous assignee (changelog):
[~accountid:{{#changelog.assignee}}{{from}}{{/}}]

 If this still does not work, for the sake of testing - hard code the account ID and see how the comment will turn up.

Have you verified the account ID - is it a valid ID and points back to the correct username?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS

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