Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Using Web hook and configuration

serge calderara
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2024

Dear all,

We have a jira DC which need to send project issue information on create and update trigger.

We have actually 2 option for doing this :

  • Automation rule
  • Web hook

The question we have actually is that we would rather prefer web hook as it is handling sending by itself behind the scene.

Q1 : Does the web hook end point can use only token as part of the URL or is it posible to have basic auth ?

Q2 : When an CREATE / UPDATE even is trigger in web Hook, does the all issue fields are send as the body or can the body be customized ?

Q3 : When UPDATE trigger is use and Comment field is set for update, does only the comment field is send as body to the endpoint or does it send all time the full issue fields ?

Thanks for this clarification

regards

2 answers

1 accepted

0 votes
Answer accepted
Nicketa October 4, 2024 edited

Hello @serge calderara ,

 

You can use Automation for Jira as well. End points can be customized.

 

Screenshot 2024-10-04 135558.png

 

For update also, you have to decide on which field value update you want to send update.

Screenshot 2024-10-04 140323.png

 

BR,

Nicketa

Nicketa October 4, 2024

Q1 : Does the web hook end point can use only token as part of the URL or is it possible to have basic auth ?

Authorizations can be used like below:

Screenshot 2024-10-04 140829.png

Q2 : When an CREATE / UPDATE even is trigger in web Hook, does the all issue fields are send as the body or can the body be customized ?

ANS: You can keep it as custom data.

Q3 : When UPDATE trigger is use and Comment field is set for update, does only the comment field is send as body to the endpoint or does it send all time the full issue fields ?

ANS: If you have customizations, you can choose it.

serge calderara
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2024

@Nicketa thanks for your reply.

IN my automation, I have a issue update trigger.

Then what I notice is that if I change any default issue field like priority, description,... then the payload catch the change and we can see update field in post request.

But if we add a comment to the issue or even an attchment, then nothing is track in the payload.

Any idea why attachment and comment update does not get send ?

regards

Nicketa October 4, 2024

@serge calderara 

You might need to review the payload for comments and attachments.

For Attachments, can refer to: https://confluence.atlassian.com/jirakb/how-to-add-an-attachment-to-a-jira-issue-using-rest-api-699957734.html

For comments, https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-add-comment-8946422/

Can try below format:

{
"update": {
"comment": [
{
"add": {
"body": "{comment}"
}
}
]
}
}

BR,

Nicketa 

serge calderara
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2024

@Nicketa you did not understnd my request.

what I need is that when I update an issue throught automation and send a web request with option ALL DATA and not custom, I need to have ALL data in the payload even comment or attchment change but they do not appears as part of the Update triger

This was my question

Nicketa October 7, 2024

@serge calderara , please raise support request with Atlassian https://support.atlassian.com/contact/#/ 

I believe technical analysis will be required for the root cause.

0 votes
Evgenii
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2024

Hi, @serge calderara 

 

I already passed that way. And I think, that Jira Automation is better. About your questions:

A1: Only tokens, you can't use password there

A2: Body can't be customized and it's very bad. It sends event type and new data

A3: Only changes and basic fields, not all.

You can test it by yourself. Just google "webhook online testing tool". There are many such services. They'll give you url, which you add in Jira, and send there events. 

For example, I used such service, and received next answer for comment event:

Screenshot_15.png Screenshot_16.png

Why it's better to use automation for me - it's more flexible in configuration. You can change request body.

serge calderara
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2024

@Evgenii thnaks for your feedback.

I agreed from automation that it is better to use it in case you need to have full control on what is send.

But if you need to send all time the full issue fields and let the other side application pick up what it needs, then I guess WebHook are better in that send as you do not have to pay attention on the body send.

Agreed ?

regards

Evgenii
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2024

@serge calderara from that point you're right. As always, everything depends from initial requirements :) If you don't need custom body, then it's better to use webhook, else - automation.

serge calderara
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2024

@Evgenii we are then align with same opinion.

I have read somwhere that the bootlnect of webhook is if the body is quite heavy or if there are more than one trigger occuring, send might be queue with a max queue size of 20 and if queue is full successive webhook will be ignored.

Have you heard something on this or perfomance issue on using webhook ?

An other question is that in case of Attacment are in the body, how the client app will get the attachement file ?

regards

Evgenii
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2024

@serge calderara haven't heard about such limitations. It's DC, what's the sense in it? Maybe other community members know something.

About attachments - they are not in request body. But if I'm not mistaken, there will be link to attachment. And client app can download it. Haven't tested it though. Check it by webhook tester.

Like • serge calderara likes this
serge calderara
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2024

@Evgenii if we do not use this testing tool to see the body which is send by the webhook, is there a way to see that send body somewhere in logs for instance ?

I ask this beacause in sensitive sector some URL are blocked for security issue and I am trying to find an other way to get that full body check

regards

Evgenii
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2024

If you have ScriptRunner, you can make custom local REST endpoint in Jira and send data to it.

serge calderara
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2024

@Evgenii , I will try that

Like • Evgenii likes this
serge calderara
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2024

@Evgenii , I have create a basic script runner endpoint as below

https://docs.adaptavist.com/sr4js/latest/features/rest-endpoints 

Then I create an issue from my instance but the endpoint did not execute

any idea ?

Evgenii
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2024 edited

You need to make rest endpoint and set it as webhook url. 
Without code I can't estimate it and say why it's not working.
Or later, I'll try to find similar script in my repositories))

Evgenii
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2024

It was easier than I thought
https://yourjira.domain.xyz/rest/scriptrunner/latest/custom/getWebhook

import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.transform.BaseScript
import javax.ws.rs.core.MultivaluedMap

@BaseScript CustomEndpointDelegate delegate

getWebhook(
httpMethod: "POST") { MultivaluedMap queryParams, String body ->
log.warn(body.toString())
}

 Screenshot_17.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.12.12
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events