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

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

[Jira Automation] Set assignee as a watcher upon ticket creation

Edited

Hi all!

I'm trying to set the assignee of a ticket as a watcher. I've already read inside this community a lot of stuff that could potentially solve my problem (e.g. here). The easiest way to do it is by using smart values. However a lot of smart values that I've used do not work. So here's the situation:

  1. I've created an automation rule
  2. I'm assigning the ticket to a member within a project role
  3. I'm trying to add as a watcher the assignee using the following smart values
    1. {{assignee.key}} <- this is recommended on the Add Watcher automation action
    2. {{assignee.accountId}}
    3. {{assignee}}
    4. {{assignee.displayName}}
    5. {{issue.assignee.accountId}}

I've tried to log all the above, but nothing returns a value. Everything is null. And I can confirm that the ticket assignment works and it is assigned from this automation rule, and not from any post function, or from the project settings.

But nothing happens. I can confirm that if I add {{reporter.accountId}} to the add watcher action, then it works fine!

Any thoughts?

 

Cheers,

Alex

1 answer

1 accepted

1 vote
Answer accepted
Alexis Robert Community Leader Feb 04, 2021

Hi @Alex Koxaras , 

 

I've just tried it on my test isntance and it looks like it works fine with {{issue.assignee}} as you can see :

 

Screenshot 2021-02-04 at 12.41.28.png

 

I'm not sure if you're describing the same scenario : are you also using the Automation Rule to set the Assignee ?

 

Let me know if this helps, 

 

--Alexis

Hi Alexis!

Thank you for your swift reply. Unfortunately, mine doesn't work. As you can see, I assign the user in the prior step before adding him as a watcher. I can confirm that whenever I create a ticket the first IF statement is activated.

My user has all roles assigned to him within the project (in this instance as an IT manager) and has all the necessary permission to be assigned to the project (I'm eligible to assign him the issue from the "reporter" account id).

New Project (1).jpg

Alexis Robert Community Leader Feb 04, 2021

Hi @Alex Koxaras ,

 

I have tried again and you're right : it won't work if you have an action to Assign the issue and then use that value for the watcher.

I've how to fix this : you need to add "Re-fetch issue data" between the "Assign" and "Add watcher" steps : 

 

Screenshot 2021-02-04 at 13.34.04.png

 

This way works for me at least.

 

Thanks,

 

--Alexis

Like Jack Brickey likes this
Jack Brickey Community Leader Feb 04, 2021

Yep this is a know limitation and the refetch is the solution. Or you can break the rule into two rules.

Hi Alexis!

That did the trick! The force is strong with you (Adam Driver got me laughing so hard)!

Thank you for trying solving this problem. When you actually select the re-fetch data, it actually stated when this should be used.

Insightful!

 

Cheers,

Alex

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Jira Service Management

Security Advisory for Jira Service Management

On October 20, 2021, Atlassian published a security advisory for Jira Service Management. The full advisory is available at this link.  We've seen a number of questions already asking for...

242 views 1 2
Read article

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