Jira Automation rule to create an issue based on a template and a custom field

Biancha
Contributor
January 18, 2023

Hi All, 

Hoping someone can help. 

Expected outcome: When a Version is created in the Jira Project, an Issue Type is created and a template is applied. 

Problem to solve: The issue is not created based on the automation due to the required fields not having values. 

Things to note:

  • We use an app called: Issue Templates for Jira
  • When creating the issue type, there is a requirement for general fields to be completed but also a custom field. 
  • The custom field is called 'Release Type' and consists of 2 requirements.
    • 1. Select Either PMU or CMU
    • 2. Select Either Major, Minor or Maintenance

Steps taken: 

  • Automation rule created
  • General fields selected from the 'Choose field to set'
  • The custom field is not supported and requires using the 'Advanced Section' to be used. 

This is the JSON Additional fields I have tried: 

{
"properties": [{
"key": "issue.templates.automation",
"value": {
"applyTemplate": "TEMP-751"
}
}]
{
"fields": {
"customfield_10548": { "value": "PMU", "child": { "value" : "Maintenance"} }
}
}
}

The above does not work error: 

Create Issue
Error while parsing additional fields. Not valid JSON.

Any pointers or help will be appreciated. 

Thank you 
Biancha

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2023

Hi @Biancha 

I have not used that addon before...Have you checked the documentation for that marketplace addon to see how it is supported by automation rules?

And I wonder if the template needs to be applied first...so...

  • perhaps create a template which has your required fields set to a default value
  • in the rule, apply the template with issue create, re-fetch the issue, and then set your required field to the desired value

Kind regards,
Bill

Biancha
Contributor
January 18, 2023

Thanks Bill, 

I have figured it out. 

The JSON Additional fields config now looks as follows:

{
"properties":[
{
"key":"issue.templates.automation",
"value":{
"applyTemplate":"TEMP-751"
}
}
],
"fields":{
"customfield_10548":{
"value":"PMU",
"child":{
"value":"Maintenance"
}
}
}
}

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 19, 2023

Well done!

So it appears there was just a comma missing between the JSON sections (template selection and data); is that correct?

Like Biancha likes this
Biancha
Contributor
January 19, 2023

That is correct, and the rule runs correctly now. The template is still not being applied; however, This would be a trial and error as I work through the Application Documentation. 

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events