Forums

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

JMWE Conditional - Only create subtasks for new users added to multi-user field

Joylene Aguirre January 22, 2024

I have successfully created an event-based action that creates subtasks for all users in a multi-user picker list (called 'Reviewers') upon the creation of an issue.

Now I want to do the same only for users that are added to the list without duplicating subtasks that already exist for users in the list. I have figured out how to trigger the event-based action when the Reviewers field is updated and now I need to iterate over the list of users and only execute for users who aren't already assigned to a subtask.

It would be nice to be able to delete subtasks for users that are removed from the list as well if possible.

2 answers

1 accepted

0 votes
Answer accepted
Teja(Appfire) January 23, 2024 edited

Hi @Joylene Aguirre ,

Thanks for reaching out!

We are from Appfire, a vendor of the JMWE app. We’ll work with you and need a few details from your end.

A support ticket is created in our support portal for this case: https://appfire.atlassian.net/servicedesk/customer/portal/11/SUPPORT-165730.

We’d like you to sign up for the portal and let us know your username so that we can mark your ID as the reporter so you will be able to access the ticket.


Please find the below link to sign up on the portal: https://appfire.atlassian.net/servicedesk/customer/portal/11.


We are looking forward to hearing from you!

Thanks,
Teja

Teja(Appfire) February 1, 2024 edited

Hi @Joylene Aguirre ,

Good day! I hope you are having a great day!

  • In addition to the existing event-based action, please create an additional event-based action (EBA) with a trigger based on the value of the reviewer's field.

  • To create this new EBA, navigate to the EBA section and choose "field value changed" as the trigger. Then, select the Reviewers field as the field to monitor.

Screenshot 2024-02-01 at 4.31.19 PM.png

Create Issue :

  • Then, at the Post function, Select Create and Delete Postfunctions.

  • At the Create Post function, add the code below in Iterator, update the summary, and assignee. 

Add a post function to create an issue with an iterator as

Create Issue.png

{% set added = issue | fieldHistory("Reviewers") | last  | field("added") %}
{{added}}

Set Summary :

Subtask for {{it}}

Set the Assignee : 

accountId:{{it}}

Delete Issue :

  • To delete subtasks for users that are removed from the list, add a delete post function

  • At Target issues select issues returned by following JQL Search and add below code. Please refer screenshot

Screenshot 2024-02-01 at 4.33.48 PM.png

{% set removed = issue | fieldHistory("Reviewers") | last | field("removed") %}
parent = {{issue.key}} AND assignee IN ("{{removed}}")

Delete Issue.png

Please review and let us know if there are any issues.

CS.png

Thanks,
Teja

 

0 votes
Joylene Aguirre February 12, 2024

This worked wonderfully! Thank you!

Suggest an answer

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

Atlassian Community Events