Add watcher to a JIRA ticket from confiforms

Arnau Bria October 23, 2023

Dear all,

I'm creating a ticket from a confluence form using confiforms and everything works as expected until I try to add watchers to the JIRA ticket.
My code looks like

{ "fields": 
{ "project": {"key": "CBCF"},
"summary": "$summary",
"assignee": {"name":""},
"description": "Please go to www and $description",
"issuetype": {"name": "Task"},
"labels": ["CBCFBuckets","[entry.CBCFTeam.escapeJSON]"],
"watchers": ["watcher1","watcher2","watcher3" ],
}
}

 the error I get when trying to create the ticket is:

com.atlassian.sal.api.net.ResponseException: Error communicating with Jira, {"errorMessages":[],"errors":{"watchers":"Field 'watchers' cannot be set. It is not on the appropriate screen, or unknown."}}


The only refence to adding watcher I've found is this in here where it says:

You can set additional watches to the issue what will be created, but in this tutorial we omit this step (see IFTTT macro parameter "watchers"). Could be set dynamically, referencing entry fields or record owner or modifier.

but when I try to do it in the ConfiForms IFTTT Integration Rules, under watchers, it does not add them in the JIRA ticket.

Could anyone help me, please?

2 answers

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 23, 2023

Hi @Arnau Bria 

Watchers could not be added as part of the issue creation. As technically those are added via a different API call

These are to be set in the macro parameters

Screenshot 2023-10-23 at 16.22.27.png

Alex

Arnau Bria October 23, 2023

Hi @Alex Medved _ConfiForms_ and thanks for your answer.

I already did it like this, this is what I meant by

 

but when I try to do it in the ConfiForms IFTTT Integration Rules, under watchers, it does not add them in the JIRA ticket.

 

the problem is that even adding them there like

["watcher1","watcher2","watcher3" ]

or
"watcher1","watcher2","watcher3"

they don't end up as watchers in the JIRA  ticket.
I'm using user's email as those are jira user names.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 23, 2023

watcher1,watcher2,watcher3

Each must be a username that your Jira recognizes and accepts

Arnau Bria October 23, 2023

Ok, then I guess (and hope) that this is the problem. I've been told that email is what JIRA users as usernames, but seems like it is not the case.

Thanks

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 23, 2023

You can verify that yourself, checking through the APIs - https://docs.atlassian.com/ConfluenceServer/rest/8.6.0/#api/user-getUser

Alex

Arnau Bria October 24, 2023

Thanks!
Did it and the username in both JIRA/Confluence are the email address... any other reason why the watchers are not added to the ticket?

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 24, 2023

Hard to tell... impossible to debug something like this remotely

Try adding the watcher yourself, via API - https://docs.atlassian.com/software/jira/docs/api/REST/9.11.0/#api/2/issue-addWatcher

(postman or curl)

Does it work?

Arnau Bria October 25, 2023

API worked. I'm going to do the whole thing from API instead of confluence and confiforms.
thanks for your help.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2023

API can also be invoked from ConfiForms.

But are you saying that setting the watchers parameter to the correct value representing a user does not work when called from the ConfiForms IFTTT macro?

Arnau Bria October 25, 2023

yes, but as I realized I have access to the API I prefer to create the JIRA from my applications insetad of sending people to confluence.

But yes, adding watchers in ConfiForms IFTTT macrodoes not work as expected.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2023

Could we take this via our support channel? I would love to understand what does not work for you in ConfiForms and how is that watchers parameter is configured

Arnau Bria October 25, 2023

I'm not the atlassian responsible here in my compnay. I'd have to consult.

0 votes
Muhammaad khalid
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 23, 2023

I have my conversation to get 4 years pectices to be help Google patner

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events