Incoming Webhook to Create Issue and Set Field Values

David Quiram
Contributor
December 11, 2023

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:

2023-12-11 17_33_56-_Caspio JSON Payload - Notepad.png

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'.

2023-12-11 17_34_25-Webhook.site - Test, process and transform emails and HTTP requests.png

JSM Automation:

2023-12-11 17_38_07-Automation - Jira.png

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? 

1 answer

1 accepted

4 votes
Answer accepted
Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 11, 2023

@David Quiram 

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

David Quiram
Contributor
December 12, 2023

@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. 

2023-12-12 13_55_27-Automation - Jira.png

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... 

Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 12, 2023

@David Quiram 

Could you share your audit log details? Jus to see what is the exactly error your automation is displaying.

David Quiram
Contributor
December 12, 2023

@Fernando Eugênio da Silva 

That's the odd thing. It not failing. It's just not doing what I would expect. 

2023-12-12 16_29_11-Automation - Jira.png

Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 14, 2023

@David Quiram 

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.

David Quiram
Contributor
December 14, 2023

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. 

2023-12-14 13_41_18-IT Help Desk - Details - Service project - Jira.png

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. 

 

2023-12-14 13_34_17-Caspio - Webhooks.png2023-12-14 13_34_10-Caspio - Webhooks.png

David Quiram
Contributor
December 20, 2023

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. 

Like Steffen Opel _Utoolity_ likes this

Suggest an answer

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

Atlassian Community Events