Post Deleted Worklog Id via Webhook

Barbara Theiß January 5, 2024

We sync our JIRA Worklogs to an external tool. Whenever a worklog is deleted we need to submit its id to the other  tool to delete it there as well. I created an automation rule that calls a webhook on worklog delete events. But if I use custom content for the POST value and enter {{worklog}} the rule fails.

If I post the default issue data it works but then it doesn't contain information about the deleted worklog.

Any idea how to solve this?

2 answers

0 votes
Lior Pinelis
Contributor
October 29, 2024

@Barbara Theiß @Alex Ziegltrum  did you try using System Webhook instead of automation?

https://[Your Domain].atlassian.net/plugins/servlet/webhooks#

You can configure it to be send on Worklog delete.

You can also include {worklog.id} as a variable in the URL.

 

Alex Ziegltrum
Contributor
October 29, 2024

@Lior Pinelis no, absolutely not :) Haven't thought about it, but will try it out and let you know.

 

Barbara Theiß October 29, 2024

@Lior Pinelis great idea, thank you. My external tool used to not accept url parameters but that was changed recently. So: yes, that worked! Still don't understand why automation fails but as long as there ist a solution, I am fine :-) 

Like Lior Pinelis likes this
0 votes
Alex Ziegltrum
Contributor
October 28, 2024

Hey @Barbara Theißdid you come up with a solution yet?

Barbara Theiß October 28, 2024

Hey @Alex Ziegltrum ,

I finally ended up sending the worklog as an email to mailparser.io using the worklog id as mail subject. Mailparser then passes the mail to my webhook.

Maybe there is a better solution out there but at the moment it works for me.

Like Alex Ziegltrum likes this
Alex Ziegltrum
Contributor
October 28, 2024

Hey @Barbara Theiß

thanks for your reply.

I created three automation rules, for workog created, edited and deleted. The first two work as expected. With {{issue.worklog.Id}} e.g. I can pass the value to the webhook of our external tool.

That does not work with the deleted event. The deletion event itself is recognized as expected, but there is ID with {{issue.worklog.Id}}, the audit log is empty.

How did you manage to get the ID of a deleted worklog at all?

Barbara Theiß October 29, 2024

@Alex Ziegltrum 

Don't know why but with the email action {{worklog.id}} works perfectly fine as a subject.

I just retested it within a webhook - but that's still not working there. 

By the way: I have a webhook posting to my external tool whenever an issue gets deleted - that is not a problem at all... 

Alex Ziegltrum
Contributor
October 30, 2024

Hi @Barbara Theiß 

I found two things :)

First, in the automation, where I catch the deleted event of a worklog, I can now process the {{worklog.id}} normally, can audit log it and that is the most important part, hand it over to the webhook of our billing application. 

Why this wasn't working from the beginning, I don't know, now it does.

Second, with the system webhook, it seems that I can't hand-over values in a web request body. Furthermore, the endpoint that is called needs a header with an X-Action, that also cannot be handed over.

So that seemed like a nice alternative solution, but lacks of the other options. And since the {{worklog.id}} parameter is now magically available in the automation, it solves what we need sufficiently.

Suggest an answer

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

Atlassian Community Events