Question on created multiple stories during a post function with JMWE?

I'm trying to configure a conditional post function based on 2 custom fields. They are both multi select lists. The first field I'm looking at is "Products Impacted" the second is "Supplier". If "Products Impacted" = A then I want to create a story for each "Supplier" selected with the summary: Supplier <Supplier Name>.

Is there a way to tell the post function to create a multiple stories depending on how many items were selected in the 2nd custom field? 

1 answer

0 vote

Hi Dale,

unfortunately, this is not currently supported by JMWE. The only solution is to create one Create Issue post-function instance per possible Supplier, and use Conditional execution to only run that post-function instance if the corresponding Supplier is selected.

David

Thanks David.

I was afraid that was going to be the answer. Since we have over 100 suppliers and we cannot copy a post function I don't think that would be the best solution. 

Maybe I will just create one story if the supplier is not empty. 

Also, if I wanted to find out the value(s) that was selected in the multi select list to place in another field, what would be the expression I would use? 

Hi Dale,

actually, there might be a better option. What's the maximum number of suppliers you expect to be selected simultaneously on any given issue?

As to your other question, are you using Jira Server or Jira Cloud?

Hi Dave, 

20 should be the max. 

Also, we are using Jira Cloud. 

Thanks for your help!

Dale

Hi Dale,

20 is probably pushing it, but you could create 20 instances of the Create Issue post-function, with the following configuration:

Summary:

Supplier {{issue.fields['Supplier Name'][<n>].value}}

Conditional execution:

{{ (issue.fields["Products Impacted"] | find({"value":"A"})) and issue.fields['Supplier Name'].length >= <n> }}

where <n> is the position (1 to 20) of the corresponding Create Issue post-function in the list of post-functions, and "A" is the product name.

For more info about accessing fields of an issue, refer to https://innovalog.atlassian.net/wiki/x/bwBzBg

David

Great. I think that will work. Thanks Dave!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

243 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you