Creating an automation rule to Tag the previous assignee

Dylan Brock January 24, 2021

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

0 votes
mogavenasan
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.
January 24, 2021

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

Mark Chaimungkalanont
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 24, 2021

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

{{#changelog.assignee}}{{from}}{{/}}
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 24, 2021

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.

Dylan Brock January 25, 2021

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.

mogavenasan
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.
January 25, 2021

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
Dylan Brock January 25, 2021

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. 

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 25, 2021

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.

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 25, 2021

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?

mogavenasan
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.
January 25, 2021

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
AUG Leaders

Atlassian Community Events