How to add watchers to new issue created with automation?

Vitaliy Antonov April 6, 2022
Attempting to create a new Issue with Jira Automation based on the data from current Issue. 
Added this under More Options >> Additional fields: 
{
    "fields": {
        "Reviewer": "{{initiator}}",
        "watchers": [
            "{{initiator}}"
        ]
    }
Getting this error:
CREATE ISSUE
Issues created successfully
TRD-74560
Unknown fields set during create, they may be unavailable for the project/type. Check your custom field configuration. Fields ignored - Watchers (watches)
Question: 
is there a way to add watchers this way? If so, what would be the proper syntax?

4 answers

1 vote
yaron December 6, 2022

Branch to new created ticket and add watcher: {{triggerissue.reporter}}

automation example.png

Sergei Gridnevskii
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.
February 23, 2023

He asked how to do that using Create Issue action. It is not a good idea to create hundreds of rules just for fun - both for the sake of observability and performance.

0 votes
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 6, 2022

Hi @Vitaliy Antonov 

Just to clarify, why are you looking to do it this way - rather than just using the relevant Actions?

It would be simpler to use the Actions...

  • Edit Issue: 
    • Reviewer = {{initiator}}
  • Manage Watchers:
    • {{initiator}}

Ste

0 votes
Rafał Chomik April 6, 2022

Have you tried to use a custom field ID instead of a name for the Reviewers field?

{
"fields": {
"{{watchers}}":"{{issue.customfield_XXXX.value}}"
}
}


Vitaliy Antonov April 6, 2022

@Rafał Chomik  this did not work unfortunately 

Getting error when saving the Additional Fields JSON:

Additional fields contains invalid field(s) in 'update' or 'fields' section: {{watchers}}

0 votes
Dave Mathijs
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 6, 2022

Hi @Vitaliy Antonov , welcome to the Atlassian Community!

What's the use case behind this request? Why would you like to add Watchers upon issue creation? From what I can see, the user/customer selects a Reviewer via a user picker which is then added as Watcher to the issue. Is that correct?

Are you working in Jira Software or Jira Service Management?

Vitaliy Antonov April 6, 2022

HI @Dave Mathijs

I am working with Jira Software.

The use case:
I have a primary project where initial issue is created. After initial assessment of each issue i need to create a new linked issue in different project, that is specific to the implementation group. There could be multiple linked issues created in other projects.  
I use Jira automation to create these linked issues. 
Once issue is created, i want to be a watcher on that issue, so i can get notifications. 

My plan works except the watcher part.

 

Thank you  

Yaiza Temprado August 25, 2022

I have exactly the same use case. Did you find a solution to this?

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.
August 26, 2022

Hi @Yaiza Temprado -- Welcome to the Atlassian Community!

What have you tried thus far?  For example, did you try the solution described in this thread by @Stephen Wright _Elabor8_ using the basic edit functions?

If that does not meet your needs you probably have a different use case/need.  I suggest:

  • creating a new question,
  • including a link to this thread,
  • include images of your complete rule and the audit log details of the rule execution, and
  • explain what is not working as you expect.

When you post another question in an older thread, only the people following this one will see it.  Creating the new question will make it more visible so others can help.  Thanks!

Kind regards,
Bill

Yaiza Temprado August 29, 2022

Hi @[deleted] , thanks for your answer.

The problem is that I want to add watcher not to the ticket that triggered the action, but to the cloned one. Although while cloning I'm able to set up any parameter in the new ticket, I can't find the option to add watchers there.

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.
August 30, 2022

Ah, I believe that is a known issue.  The work-around/fix is:

  • clone your issue
  • branch to "most recently created issue"
    • add the watcher in that branch
Cesar Payamps September 26, 2022

What if you also want to add watchers to 2 sub-tasks created for the cloned ticket via the same rule?

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.
September 26, 2022

Hi @Cesar Payamps 

That seems a bit more complicated, and I am having trouble visualizing what you mean.  Perhaps if you add images of your rule and the audit log details, and describe what is not working, it will provide some context for the community to offer suggestions.  Thanks!

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer