Hi Team,
I'm using JMWE Create issue(s) Post-function to create Ticket. Its working for single ticket creation. But i need to create multiple ticket based on multi select Custom field Value count.
If Multi select custom field has 2 values then i need to create 2 tickets automatically. If we selected 5 values from Multi select custom field then 5 tickets should get auto create.
It will be helpful if i get Code which works for above requirement.
Cheers.
Hey 👋
Multiple issue creation: Use this section to create multiple issues based on the settings you provide.
Iterator (displayed only when the previous option is selected): Enter a Nunjucks template that must return a comma-separated list of values to iterate on. This can be either a comma-separated list of Strings, or a JSON array only if you check the "Iterator returns JSON" option. The post-function iterates over the list and creates one new issue per value
{{issue.fields["Multi-select field"] | dump }} with "Iterator returns JSON" option selected will create one issue per selected option in the Multi-select field
https://innovalog.atlassian.net/wiki/spaces/JMWEC/pages/120815650/Create+issue+s
Best Regards
Ralf
It worked. I really appreciate your assistance, it made all the difference in solving my problem!
Thanks.
Prathap DL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Prathap DL and welcome to the community :)
You can take the code you have that creates the issue and look at the number of items in the multi select list as a count.
issue.getCustomFieldValue('Multi Select List')?.each{ currentValue ->
//paste your existing code here
// You also have the current value
// if you need to populate the issue with it
Issues.create('ABC', 'Task') {
setSummary('my first HAPI 😍')
}
}
Have a look at the following from Adaptavast's documentation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.