Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,891
Community Members
 
Community Events
165
Community Groups

Use JSON in Project Automation to update multiple cascading fields

Hi,

I am trying to build a project automation rule that will create a service request ticket every month for a particular activity that is carried out on a recurring basis. To create the ticket, I need to satisfy the mandatory fields, some of which include custom cascading fields which are not displayed in the 'Choose fields to set' part of the automation query. I therefore need to use the 'more options - Additional Fields' section to update these four fields (Notification Channel; Directorate & Business Unit; Requested Service; Application & Component).

I have tried multiple ways to get this to run, but am either ending up with

  • "Create issue - Error while parsing additional fields. Not valid JSON" or
  • "Error creating issue - Directorate & Business Unit is required. (customfield_11309), Requested Service is required. (customfield_11917), Notification Channel is required. (customfield_11908)"

 

Below is what I am using when the latter error is produced:

 

{
"update": {
"Notification Channel": [
{
"set": {
"value": "{{triggerIssue.fields.Notification Channel."System"}}",
"child": {
"value": "{{triggerIssue.fields.Notification Channel.child."Scheduled Event"}}"
}
}
}
],
"Directorate & Business Unit": [
{
"set": {
"value": "{{triggerIssue.fields.Directorate & Business Unit."ICT & Information Management"}}",
"child": {
"value": "{{triggerIssue.fields.Directorate & Business Unit.child."Digital Solutions"}}"
}
}
}
],
"Requested Service": [
{
"set": {
"value": "{{triggerIssue.fields.Requested Service."Measurement & Reporting"}}",
"child": {
"value": "{{triggerIssue.fields.Requested Service.child."User Profile Report"}}"
}
}
}
],
"Application & Component": [
{
"set": {
"value": "{{triggerIssue.fields.Application & Component."C3MS"}}",
"child": {
"value": "{{triggerIssue.fields.Application & Component.child."User Account / Security Roles"}}"
}
}
}
]
}
}

 

Any suggestions on how I can successfully get these fields to update so that the ticket can be created?

 

2 answers

1 accepted

3 votes
Answer accepted

Fixed it!! Here is what works:

 

{
"fields": {
"Notification Channel": {"value": "System", "child": {"value": "Scheduled Event"}},
"Directorate & Business Unit": {"value": "ICT & Information Management", "child": {"value": "Digital Solutions"}},
"Requested Service": {"value": "Measurement & Reporting", "child": {"value": "User Profile Report"}},
"Application & Component": {"value": "C3MS", "child": {"value": "User Account / Security Roles"}}
}}
}

I have also tried the following, but get the first error described above:

 

{
"fields": {
"Notification Channel": {"value": "System", "child": {"value": "Scheduled Event"},
"Directorate & Business Unit": {"value": "ICT & Information Management", "child": {"value": "Digital Solutions"},
"Requested Service": {"value": "Measurement & Reporting", "child": {"value": "User Profile Report"},
"Application & Component": {"value": "C3MS", "child": {"value": "User Account / Security Roles"}
}}
}

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you