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 :
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
Hello @serge calderara ,
You can use Automation for Jira as well. End points can be customized.
For update also, you have to decide on which field value update you want to send update.
BR,
Nicketa
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:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@serge calderara , please raise support request with Atlassian https://support.atlassian.com/contact/#/
I believe technical analysis will be required for the root cause.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Why it's better to use automation for me - it's more flexible in configuration. You can change request body.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have ScriptRunner, you can make custom local REST endpoint in Jira and send data to it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Evgenii , I will try that
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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())
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.