Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Post Function

valkyre57
Contributor
February 22, 2021

hello everyone

I have trouble with post function,

have added "Set field value" and then wanted to auto add watchers (three of them)

after creating issue it is adding only one randomly not all of them

any ideas what i am doing wrong

watchers.jpg

2 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 22, 2021

Hi,

to add the value to the Watchers field, you just need to check the "Add value(s) to the field" option, which you have done.

However, your problem comes from the fact that, on Jira Cloud, post-functions run asynchronously, and therefore simultaneously. And because of the lack of transactional integrity in Jira Cloud, the three post-functions end up overwriting what the other post-functions are doing at the same time.

But in your case, since you're adding three users with the same conditional execution, you don't need three post-functions. Just use one post-function and provide all three accountIds separated by a comma, as shown in the "Expected value" help tab.

valkyre57
Contributor
February 24, 2021

it works thanks a lot

1 vote
Nic Brough -Adaptavist-
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 22, 2021

The post-functions you are using are not adding watchers, they are setting the watcher each time.  Assuming they run sequentially, the second one will replace the value set in the first one, and then the the third one will again repace the value set in the second one.

valkyre57
Contributor
February 22, 2021

what to do my dear?

Nic Brough -Adaptavist-
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 22, 2021

Change to a post function that adds instead of sets the watcher.

Nodar Vardiashvili
Contributor
February 22, 2021

Hi,

there is no add watcher in JMWE. Can you help us to build-our-own (scripted) Post-function (JMWE app)? I don't know how to write nunjucks script

Suggest an answer

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

Atlassian Community Events