How to fire webhook on particular status change - jira

Hi I used webhook in JIRA and wrote the JQL query as below,
status CHANGED FROM "Waiting Security Approval" TO "Triggered FW commands"
When I use webhooks and select issues created,updated,deleted etc webhook is triggered properly and I am getting POST request in my APP.
But I get for all status change, So instead I removed all check mark and added the above mentioned JQL and in that case webhook is not fired.
How can I debug it? JIRA Version what is use is "v7.1.4"

You've misunderstood the JQL part of the Webhook - it's to narrow down the list of Issues for which a Webhook will be emitted when any of the conditions, that you've checked/selected, apply.
So, for example, you can specify (with the JQL) that you only want this Webhook to apply for Issues in Project ABC or for all Issues where you're the Assignee but it will still be only be fired on the events that you've selected in the checkbox groups.
What you need to do is create a Webhook that will fire on event "Issue updated" and when you receive it in your application check whether this update transitioned the Issue from the Status you want to the other one. If it did, do something, else ignore the Webhook.

Related

Is there any way to run a Jenkins job on Zephyr Squad for Jira test-case execution status change?

So i have a private Jira Server 8.5.7 with Zephyr Squad (9.1.3) plugin for it.
What this plugin does is adds a custom fields with Test Steps and Test Execution Status to the Jira Issue.
Test Steps
Test Execution Status
What i need to do is to make Jira send an API request to remote Jenkins server once Test Execution Status has changed(by the QA Engineer).
The problem is that these custom fields are not CustomFields in Jira-terms - they are not shown on a Custom Fields page for the project. It does not appear on Workflows(because its not part of Issue flow, rather inside one), so i cant use webhooks. I cannot add a Custom Event for them changing. I also cannot add a Custom Listener for that Execution status change, because there's nothing to connect to - when i change the Execution Status the IssueUpdate event does not fire. No event is fired at all.
It just sends a request to Zephyr's own plugin API (/rest/zephyr/)
I dont know if it was made intentionally or just with flaws or am i stupid.
Is there any way to make Jira send API requests one that execution status change? Maybe there is Listener class specific for that execution status i dont know about? Or maybe one could write a custom plugin to attach to that status change somehow?
The Jira and Zephyr versions are highest i could get.
I know i can make it work with Jira Issue status change, but that would be my last resort.
If anybody else got stuck with this.
I never found a way to do it with Zephyr Squad. However, there is a similar thing called Zephyr Scale.
Basically, does all the same things, has a slighty different UI, but most importantly - triggers an event when test execution status changed, which could be set on listener.

How to get the email/name of the user that initiates a Jira Webhook

I'm working on a internal integration with Jira and I need to perform an action when a ticket is moved between boards. I've setup a Automation trigger that sends a web requeest but I'm not sure how to get the name of the user that performs the action.
Although Atlassian's docs are all over the place, I found out that there is an action object that is passed but nothing more.

How to set automatic reply with changing issue status into "In progress" as first response in Jira

We use Jira to handle client issues. When a customer raises an issue, as the first response for issues, we changes issue status into "In Progress" and send reply to customer. I need to automate this procedure.
You may use Jira Workflow post functions to set specific actions that Jira should do when some issue changes its Status.
Here is more details on this matter: https://support.atlassian.com/jira-cloud-administration/docs/configure-advanced-issue-workflows/
Also, you may search for the 3rd party Jira apps that add extra automations here:
https://marketplace.atlassian.com/search?query=automation
Thanks,
Oleh

Gerrit notification for commits without any action

In the Gerrit documentation there is no configuration setting, which could be used to automatically send emails if there was no action with a commit for a given period of time.
There is a notification type, abandoned_changes, but it means that the change was already abandoned.
What I want is an e-mail notification if the commit was not abandoned, but there was no action with it, like Hey, do you really need this commit?
You can't configure Gerrit to send this type of notification but you can search for open changes which are not updated for a while like in the following example:
is:open AND age:1week
See more info about search operators here.
You can make a script (bash, perl, etc) to execute the query using REST and send the result by e-mail.
See more info about query changes using REST here.

Asana Webhooks API

So I have implemented the Asana Webhooks API as described in their documents. I can pass it a project ID and request a new webhook be created. The API successfully sends a authentication request to my application which returns the Security header as described in the Docs. Asana then returns the expected success response, outlining the newly created Webhooks unique ID.
Now if i take this ID and then query the Asana API to show me all configured webhook's on either the parent Workspace or the project resource directly it returns an empty data JSON Object or reports the resource doesn't exist, suggesting the Webhook Ive just created wasn't actually created, despite giving me the expected success response.
Also If I then make a change to a project it doesn't fire the webhook and I don't receive any events on my application.
Strangely everything was working on Friday but today (Monday) I'm experiencing these issues.
Any pointers would be good, Ive been working as the Docs suggest in terms of my request structure and am authenticating using a PAT, Ive even tried a newly created token.
Thanks,
Our webhooks use the handshake mechanism to make sure that it's possible to call you back, but there's always the possibility that subsequent requests can fail. Additionally (although we don't document this very well - there's an opportunity for us) we should immediately try to deliver a (probably) empty event after the handshake (it looks like {"events":[]}. This is kind of like a "second callback" that contains anything that has changed since you created the webhook.
If this fails - or if any subsequent request fails often enough - the webhook will get trashed. "Failure" in this context means returns HTTP response codes other that 200 or 204.
As for why you're having trouble querying the webhook itself, I wasn't able to repro the issue, so we'd have to dive deeper. It should be fine if you:
Specify the workspace
Optionally specify the resource
I tested this out, and it seemed fine. You also might want to directly query the webhook by id with the /webhooks/:id endpoint - note to use the id of the webhook returned by create, and not the id in the resource field.
If you created the webhook (specifically, your PAT or OAuth app was the one making the create request) you should see the information just fine. If you can get the webhook by id, you should see last_failure_at and last_failure_content fields which would tell you why the webhook was unable to make the delivery.
Finally, if you would like to contact us at api-support#asana.com and let them know more details (for instance, the ID of the webhook you're trying to look at) we can look at those fields from our side to see if we can identify what's going on.

Resources