Source of update

I am using both the rest api and webhooks. Is it possible in the webhook to know the source of an update (for example a project description can be updated via rest or via the jira ui)

thanks

1 Like

@julian you can get the information from the issue, the event that triggered the webhook, and the user who triggered it as explained in the JIRA Webhooks Documentation.

But it doesn’t provide you with information on if this was done through the UI or through the REST API.

1 Like

@pvandevoorde, ok thanks for the input.

Is there a way of turning off a webhook notification for a certain item like project “foo” if I am updating using the rest api ?

I am trying to keep an internal system in sync with jira - if someone updates jira, the internal app needs to know about it (hence the webhook). However, if the internal app is updated, I also need to post the change to Jira. Unfortunately, this api call fires the webhook as well … so I get into a circular argument about who updated … :wink:

Hi @julian,

The best way to do this is to set a project property on the project, then in your webhook, use a JQL filter to only send webhooks for issues in projects that either have this property or don’t have this property.

https://docs.atlassian.com/jira/REST/cloud/#api/2/project/{projectIdOrKey}/properties

Regards,
Dave

1 Like

@dmeyer thanks for the tip. However, this would involve several requests from the rest “side”

scenario 1:
1 create a property
2 send the new project data
3 jql query to check if there is this property
4 delete this property : (a) this has to be done in case a jira UI update occurs and (b) when do you decide to delete it ? - after all you’re not getting the webhook event now, so this becomes a race condition

scenario 2:
1 create a property
2 send the new project data
3 receive webhook
4 api check for existence of said property
5 delete property

scenario 3:
1 delete a property
2 send the new project data
3 jql check for non-existence of property
4 api create this property : (a) this has to be done in case a jira UI update occurs and (b) when do you decide to create it ? - after all you’re not getting the webhook event now, so this becomes a race condition

As you can see, all very messy. If only we had a “source” header (“jira/rest/api”) :wink:

Also, (Project webhook changelog) could you tell me why the project webhook does not receive a changelog ?