In JMWE, I have this functional template applied to a Create Issue post function for a standard issue type that creates multiple subtasks and assigns them based on named users in a projectRole. I cannot find a means to iterate through the members' User Properties to build the unique Summary.
Here is what I have that supplies the Summary:
(Testing): {{ issue.fields.summary }} - {{issue.fields.assignee | userProperty("dept")}}In the Assignee value, I use this template to iterate through the list.
{{it}}In the multi-issue creation block, I supply this template which builds the member list for each assignee.
{{'Clowns' | roleMembers | join(',')}}For each affected user, I used JMWE's User Property Editor to set these name value pairs.
name: dept
value: CLK
name: dept
value: ACC
etc...
The outcome of this post function creates all subtasks with this Summary:
(Testing): This is the summary value - CLK
This is great for the first user's issue, but I need a way to iterate through this list to append the user property value to the Summary given the value of dept for each user. For instance, another user in the list should have a summary like this.
(Testing): This is the summary value - ACC
I thought about setting the dept value on the newly added subtask but that subtask does not yet exist since I'm creating it on the fly. I could use some help with a script if you'd be so kind. I'm assuming I can bundle the script into the template here to generate the unique Summary during creation.
None of this script here that I've been building has yielded something functional yet but here's what I have in thought.
{% set regex = r/dept/ %}
{% for dept in "User Property" | availableOptions %}
{% if regex.test(dept.value) %}
{% set summary = "(Testing): issue.fields.summary }} - {{issue.fields.assignee | userProperty("dept")}} | find({userProperty("dept") | int}) %)Thank you for reading,
-Paul