0

I want to get the notifications about any change in any issues in my jira server.

I have basic code for connecting jira from java code using jira-rest-java-client library that they have provided.

I searched their javadocs and also went through some classes in that API library but I could not find any methods/classes which would be helpful to me.

Does anyone know if it is possible to get notification events from changes in jira to my java code (may be via polling or something like that).

jww
  • 97,681
  • 90
  • 411
  • 885
Abubakkar
  • 15,488
  • 8
  • 55
  • 83

1 Answers1

3

What do you want to achieve?

  1. You want to have push notifications? There isn't any, IMHO. UPDATE: However, there is this WebHook thingy: https://confluence.atlassian.com/display/JIRA/Managing+Webhooks. I have no expertise with it, but it is promising, please read this short introduction also: http://blogs.atlassian.com/2012/10/jira-5-2-remote-integration-webhooks/.
  2. You are looking for something that gives you back what changed in the last N minutes, something like the Activity Stream? You can get the RSS feed of Activity Streams for Projects and for Users.

How

The base URL is https://jira.contoso.com/activity. Then you can append querystring parameters, like maxResults for paginating.

Selecting the data source is through the filters you provide in the streams parameter. It looks like it is JQL, but it's not.

Examples:

  • List a project's activites: ?streams=key+IS+SOMEPROJ.
  • List a user's activites: ?streams=user+IS+foobar.
  • List event between two dates: ?streams=update-date+BETWEEN+1425300236000+1425300264999. (Note: the epoch is the millisecond precision epoch.)
  • List user activities in one project: ?streams=user+IS+JohnDoe&streams=key+IS+PROJECTKEY.
  • More complex ones: ?streams=user+IS+JohnDoe&streams=key+IS+PROJECTKEY&streams=activity+IS+issue:close

Watch out, it is case sensitive, on my JIRA 6.1.9, if I write Is instead of IS, I get an error page (but not if AFTER is not all uppercase o.O).

Also note, that spaces should be encoded as plus signs (+), not URL encoded (%20 for spaces).

If you go to your JIRA, and fetch the following URL: https://jira.yourserver.com/rest/activity-stream/1.0/config, it will list all the combinations it accepts.

What

The call returns a standard Atom feed. You can then process it with XML query tools, or with other Java-based RSS/ATOM reader libraries.

Noteworthy document about this topic: https://developer.atlassian.com/docs/atlassian-platform-common-components/activity-streams/consuming-an-activity-streams-feed

Community
  • 1
  • 1
Koshinae
  • 2,240
  • 2
  • 30
  • 40