I will preface this with I have good experience with Jira Automation, but no experience with JSON and have been trying to piece this process together.
We're currently trying to understand the fundamentals of getting an incoming webhook to create a ticket and place values in specific fields.
To be clear, our automation creates a new issue, but it doesn't place data into the fields.
We have an external form in Caspio and have setup a webhook to be sent to our JSM when a form is submitted. We would like this webhook to take the data from the form and place it in corresponding fields in our JSM.
I've bounced around several different pages trying to understand this, but the documentation isn't clear enough for me to piece together. From reading Working With Incoming Webhook Data in Automation for Jira I understand that I will need to use the {{webhookData}} smartvalue, but I'm not understanding where to use that smartvalue.
Here is my setup for context.
Caspio Webhook Custom Payload:
Result of Webhook Payload: This screenshot was from one of my early tests. This proves that the correct data is being pulled from Caspio and sent along in the payload. I know I will have an issue with the dueDate field as the data isn't formatted correctly. That's a 'future DQ problem'.
JSM Automation:
I'm showing the 'Additional Fields' section to show I don't have anything in it. Given that my previous tests of this configuration will create an issue, but not put data in the fields, I'm going make a wild assumption that we need to use the 'Additional Fields' section?
Is this were we would use the {{webhookData}} smart value? If so how?
Trying to give a brief explanation. You just need to understand basic indentation concepts.
Let me explain:
Your JSON carries a payload in this order: Fields > Partner Survey Organization Name
A structure to use webhook if I want to retrieve this value in a field, I must pass the webhook variable with the field indentation. It would look something like this: {{webhookData.fields.Partner Survey Organization Name}}
WebhookData = Data Collected
Fields = Entering inside the JSON fields structure
Partner Survey Organization Name = Is the name of the field inside the response I want to collect
Do you understand that I am declaring the value that Organization Name brings?
In the next fields, just follow the same example, changing the reference field.
You can put this in a custom field in your automation or declare it all in the 'description' field.
If you already have custom fields to consume this information, click on 'Choose fields to set' in your automation, choose the field and within the field define the corresponding webhookData variable that fills this field.
Repeat this for the remaining fields.
Hope this helps you
@Fernando Eugênio da Silva thank you for your response. This does help me understand the indentation better.
I do have custom jira fields for all these pieces of data. I added the fields in my create new issue element, and put the smart value like this. Like before it creates my issue, but will not put the data into the Jira fields.
Do I need to first create the issue and then edit the issue later in the automation? Or do I need to add double quotes around the field names since some of them contain spaces? If that was the case I would think that at least the budget and due date fields pictured above would have worked with the rest failing...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you share your audit log details? Jus to see what is the exactly error your automation is displaying.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's the odd thing. It not failing. It's just not doing what I would expect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How Jira collect your webhook data? In your automation rule there is some GET web request to collect those datas?
As you're using webhook values, this values needs to be intended by your rule either using an associated webhook or using a web request with GET / POST in your automation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So as I mentioned in the original post. We are using Caspio, a low code database, to send the webhook and custom payload to our JSM project. The start of our automation is the webhook trigger.
I tried using Caspio's default payload, but it errors in the automation because of the structure. This is why we opted to try using a custom payload and I thought we were formatting in a way that Jira would be able to understand and use.
I feel like this IS being read by Jira, because when I forgot to add the (jiraDate) format variable to the smart value in the Jira automation, it would throw an error that the format of the due date was incorrect, because it does contain a timestamp coming from Caspio.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I ended up reaching out to Support on this issue and they were able to assist a little further and put things into a better context with the automation side of things.
Adding a log function with {{webhookData.fields}} is huge to just see the data coming in.
The other thing was my formatting of the values in the create issue step was slightly off.
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.