I am wondering if there is a way to create an automation in Jira that updates both values of a cascading field based on text in the Description. Long story short, I have created a Slack form that generates a Jira issue, but due to certain requirements, it is a manual form so every answer to a question goes into the "Description" field.
I would like to reference a part of said text in the description field in the automation so that it then updates the corresponding Cascading, custom field.
I've gotten halfway there but my JSON gives me the "Error while parsing additional fields. Not valid JSON."
So heres how I want it to work ideally:
Below is the JSON I have tried thus far:
1.
"fields": {
"customfield_12345" : { "value": "fake_text1", "child": { "value" : "fake_text2"} }
}
}
2.
{
"set": {
"customfield_12345": [
{
"set": {
"value": "{{triggerIssue.fields.Sample Cascade.fake_text1}}",
"child": {
"value": "{{triggerIssue.fields.Sample Cascade.child.fake_text2}}"
}
}
I think my biggest hangup is not knowing where/how to reference the custom field ID (Another cascading field exists by the same name) and also not understanding if the "Fake Text" should have a space between words, or an underscore in the JSON.
Any help is greatly appreciated! Thank you!
Hi again! Figured out what went wrong here. Just sharing in case it helps someone else
1. I checked the actual custom field value configuration and found that the option I was testing had an extra space at the end. I deleted it and the below code worked flawlessly afterwards.
2. Another notes is that I thought I had to use underscores instead of spaces in the value names but the spaces worked just fine.
Successful JSON below
{ "fields": { "customfield_12345": {"value": "First Value Name Here", "child": {"value": "Second Value Name Here"}} }} }
Thank you @YogeshKR for your help as well!
Hey @SheLa Newburn and @YogeshKR any ideas why my JSON is not working?
{
"fields": {
"customfield_1234": {
"value": "Issue",
"child": {
"value": "Hardware"
}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @SheLa Newburn ,
Below JSON worked fine for me!
I copied a value from triggered issue.
{
"update": {
"customfield_12345": [
{
"set": {
"value": "{{triggerIssue.fields.customfield_12345.value}}",
"child": {
"value": "{{triggerIssue.fields.customfield_12345.child.value}}"
}
}
}
]
}
}
Hope this helps!!
Regards,
Yogesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @YogeshKR
I tried it and interestingly enough, it no longer gives me and error but it still doesn't update the values in the field. I can see in the automations audit log that the rule even runs successfully, but nothing changes in the actual issue. Any thoughts as to why that may be?
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.