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

This widget could not be displayed.

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 Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Monday in Marketplace Apps

The 7 hacks of highly successful automation

...there's anything I've learnt from working, it's that people are lazy! No offense to anyone reading this, but it's true and we can all admit it. The easier you make something for someone, the more...

340 views 0 13
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