Skip to main content
Kinetic Community

Jira Source

This source handles webhook calls from Jira to run Task Trees whenever issues are created, updated, or deleted.

Creating a Source

First download the consumer file and place it into the WEB-INF/consumers directory of your Task application and then restart the web server.

To use the consumer, navigate to the Sources page (underneath the Admin tab) and click Add New Source. When creating a source, the type field essentially tells Kinetic Task which consumer file to use for that source.

jira_source.png

Now that we have created a Jira source we will be able to develop trees that refer to Jira-specifc information like issue data.

Configuring a Webhook

To have Jira run our Task Trees we need to use webhooks. Webhooks can call the Task API whenever certain events occur and they will pass information about those event to Task as well.

Start by going to the System page (click the gear dropdown menu in the top right corner).

system_link.png

Then click the WebHooks link on the left navigation bar. It is located near the bottom of the page.

webhooks_link.png

Finally, click the Create a WebHook button to open the webhook form.

create_webhook_button.png

Below is a screenshot of the webhook form. The two most important fields are URL and Events.

URL

The url tells Jira where to send the data. Urls to run a tree use the following format.

https://mytaskserver.mycompany.com/kinetic-task/app/api/v1/run-tree/SOURCE/GROUP/TREE

Given the source "Jira", the source group "Issue", and the tree name "Create" we would use the following API route. 

https://mytaskServer.mycompany.com/kinetic-task/app/api/v1/run-tree/Jira/Issue/Create

Events

The events tell Jira when to send the data. For example, if we check each of the boxes highlighted below, Jira will call Task every time an issue is created, update, or deleted.

webhook_form_1.png

Below is the rest of the webhook form. It contains a large number of other events that can trigger webhooks, but for this source we focus on the issue related events.

Finally click the Create button to save the webhook.

webhook_form_2.png

Source Data

predefined_values.png

When the Jira webhook calls the Task API it passes along a JSON string of data. In Task this is referred to as Source Data. The consumer then parses the source data and provides the menu of pre-defined values available within the Tree Builder. An example of the pre-defined values menu is shown on the right.

In the Pre-defined Values section below we describe each of the pre-defined values made available by the Jira source.

The Example Source Data section gives an example of real source data that was posted to Kinetic Task from Jira.

Pre-defined Values

Jira Issue

Id
Key
Summary
Description
Issue Type
Status Name
Project Key
Project Name
Creator Name
Creator Email
Creator Username
Timestamp

Example Source Data

{
   "timestamp":1421378384113,
   "webhookEvent":"jira:issue_updated",
   "user":{
      "self":"https://kineticdata.atlassian.net/rest/api/2/user?username=shayne.koestler",
      "name":"shayne.koestler",
      "key":"shayne.koestler",
      "emailAddress":"shayne.koestler@kineticdata.com",
      "avatarUrls":{
         "48x48":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=48",
         "24x24":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=24",
         "16x16":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=16",
         "32x32":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=32"
      },
      "displayName":"Shayne Koestler",
      "active":true,
      "timeZone":"America/Chicago"
   },
   "issue":{
      "id":"13313",
      "self":"https://kineticdata.atlassian.net/rest/api/2/issue/13313",
      "key":"JUNK-7",
      "fields":{
         "issuetype":{
            "self":"https://kineticdata.atlassian.net/rest/api/2/issuetype/10101",
            "id":"10101",
            "description":"A new feature of the product, which has yet to be developed.",
            "iconUrl":"https://kineticdata.atlassian.net/download/resources/com.atlassian.jira-core-project-templates:jira-softwaredevelopment-item/newfeature.png",
            "name":"New Feature",
            "subtask":false
         },
         "timespent":null,
         "project":{
            "self":"https://kineticdata.atlassian.net/rest/api/2/project/10600",
            "id":"10600",
            "key":"JUNK",
            "name":"Junk",
            "avatarUrls":{
               "48x48":"https://kineticdata.atlassian.net/secure/projectavatar?pid=10600&avatarId=10011",
               "24x24":"https://kineticdata.atlassian.net/secure/projectavatar?size=small&pid=10600&avatarId=10011",
               "16x16":"https://kineticdata.atlassian.net/secure/projectavatar?size=xsmall&pid=10600&avatarId=10011",
               "32x32":"https://kineticdata.atlassian.net/secure/projectavatar?size=medium&pid=10600&avatarId=10011"
            }
         },
         "fixVersions":[
         ],
         "aggregatetimespent":null,
         "resolution":null,
         "resolutiondate":null,
         "workratio":-1,
         "lastViewed":"2015-01-15T21:19:21.903-0600",
         "watches":{
            "self":"https://kineticdata.atlassian.net/rest/api/2/issue/JUNK-7/watchers",
            "watchCount":1,
            "isWatching":true
         },
         "created":"2014-09-16T15:21:45.030-0500",
         "customfield_10020":null,
         "customfield_10021":"Not Started",
         "customfield_10100":null,
         "customfield_10300":null,
         "labels":[
         ],
         "customfield_10016":null,
         "customfield_10017":null,
         "customfield_10018":null,
         "customfield_10019":null,
         "timeestimate":null,
         "aggregatetimeoriginalestimate":null,
         "issuelinks":[
         ],
         "assignee":null,
         "updated":"2015-01-15T21:19:44.106-0600",
         "status":{
            "self":"https://kineticdata.atlassian.net/rest/api/2/status/10001",
            "description":"Work on the issue has not yet begun.",
            "iconUrl":"https://kineticdata.atlassian.net/images/icons/statuses/open.png",
            "name":"To Do",
            "id":"10001",
            "statusCategory":{
               "self":"https://kineticdata.atlassian.net/rest/api/2/statuscategory/2",
               "id":2,
               "key":"new",
               "colorName":"blue-gray",
               "name":"To Do"
            }
         },
         "components":[
         ],
         "timeoriginalestimate":null,
         "description":"Testing webhooks again. Changing the description which should call the webhook on an update.",
         "customfield_10012":null,
         "customfield_10013":null,
         "customfield_10014":null,
         "customfield_10015":null,
         "customfield_10401":null,
         "customfield_10006":"9223372036854775807",
         "customfield_10007":null,
         "customfield_10008":null,
         "attachment":[
         ],
         "aggregatetimeestimate":null,
         "summary":"Testing webhooks again",
         "creator":{
            "self":"https://kineticdata.atlassian.net/rest/api/2/user?username=shayne.koestler",
            "name":"shayne.koestler",
            "key":"shayne.koestler",
            "emailAddress":"shayne.koestler@kineticdata.com",
            "avatarUrls":{
               "48x48":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=48",
               "24x24":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=24",
               "16x16":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=16",
               "32x32":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=32"
            },
            "displayName":"Shayne Koestler",
            "active":true,
            "timeZone":"America/Chicago"
         },
         "subtasks":[
         ],
         "reporter":{
            "self":"https://kineticdata.atlassian.net/rest/api/2/user?username=shayne.koestler",
            "name":"shayne.koestler",
            "key":"shayne.koestler",
            "emailAddress":"shayne.koestler@kineticdata.com",
            "avatarUrls":{
               "48x48":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=48",
               "24x24":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=24",
               "16x16":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=16",
               "32x32":"https://secure.gravatar.com/avatar/97f1a50d8087ec3ce72a990bfe42941f?d=mm&s=32"
            },
            "displayName":"Shayne Koestler",
            "active":true,
            "timeZone":"America/Chicago"
         },
         "customfield_10000":null,
         "aggregateprogress":{
            "progress":0,
            "total":0
         },
         "customfield_10001":null,
         "customfield_10200":"1|i0004z:",
         "customfield_10003":null,
         "customfield_10400":null,
         "environment":null,
         "progress":{
            "progress":0,
            "total":0
         },
         "comment":{
            "startAt":0,
            "maxResults":0,
            "total":0,
            "comments":[
            ]
         },
         "worklog":{
            "startAt":0,
            "maxResults":20,
            "total":0,
            "worklogs":[
            ]
         }
      }
   },
   "changelog":{
      "id":"20412",
      "items":[
         {
            "field":"description",
            "fieldtype":"jira",
            "from":null,
            "fromString":"Testing webhooks again",
            "to":null,
            "toString":"Testing webhooks again. Changing the description which should call the webhook on an update."
         }
      ]
   }
}