Use JSON in Project Automation to update multiple cascading fields

niggles20 May 5, 2022

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
niggles20 May 5, 2022

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"}}
}}
}

0 votes
niggles20 May 5, 2022

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