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
If I understand correctly, you still want to create a single issue per role member, but you'd like to modify the Summary of the new issues.
I'm not sure I understand the need to enumerate all entity properties. Can you provide an example?
However, to get the dept property of the "current role member", you could use
{{it | userProperty("dept") }}
Ah! The likely magic biscuit. Essentially, embedding the iterator into the specific field to iterate through. I'll try it tomorrow.
I'm never creating more than 8 subtasks during this `create issue` post function. I merely want to append the Summary of each newly created issue with the value of 'dept' given the user found in that project's projectRole with a dept property. Essentially, append the summary with this extra bit of data after the dash shown underlined.
(Testing): This is the summary value - CLK
(Testing): This is the summary value - ACC
etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
David, how do I specify the iterator to build the part of the summary shown underlined above? I can see how this works as a standalone, but I can't find syntax to embed this into the template. Thanks again.
Using this:
(Testing): {{ issue.fields.summary }} - {{issue.fields.assignee | it | userProperty("dept")}}
...yields a template-error - (string) Error: filter not found: it
I tried to embed the iterator inside of it but there are too many curly braces.
(Testing): {{ issue.fields.summary }} - {{issue.fields.assignee {{it | userProperty("dept")}}}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try what I provided earlier?
(Testing): {{ issue.fields.summary }} - {{it | userProperty("dept")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem, David, is that I need to loop through each assignee of the newly created issues in order to get the assignee's dept user property.
This one only works for the first individual.
To set the Summary field:
(Testing): {{ issue.fields.summary }} - {{issue.fields.assignee | userProperty("dept")}}
{{'Clowns' | roleMembers | join(',')}}
(Testing): This is the summary value - CLK
(Testing): This is the summary value - ACC
I get this, with the same dept value at the tail of the Summary:
(Testing): This is the summary value - CLK
(Testing): This is the summary value - CLK
Notice that the dept value at the end of the summary gets repeated instead of set from the individual's user property. I haven't found a way to embed this additional iterator into the stream if that's possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Again, did you try the snippet I shared? It should do exactly what you want, since the it variable represents the accountId of the user who becomes the assignee of the new issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, David. I somehow goofed this up. Your suggestion works perfect. Sorry about that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unrelated, David, is there a means to avoid generating a notification to the assignee of the newly added issue that occurs during this `create issue` post function? I'd like to prevent those users from receiving this notification but there is no configurator on this post function to suppress the notifications. Evern if there were, however, it probably would need to reach out to the newly added subtasks and suppress those notifications. I thought about leaving these newly added subtasks unassigned, but that won't work since I am assigning them now as part of this create issue post function and building the Summary field based on key data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, there is no way to disable the notification emails. That's a limitation of Jira Cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.