Jira Connector

With Flint's Jira Connector you can perform Create , Add comment, Update Comment ,Delete, Resolve , Add worklog and Notify operations on a issue.

With this document guide you will be able to work with and use a Jira Connector.While you start configuring the connector, this document will guide you through Jira Connector request and response parameters.

Design Aspects

Perform all standard application operations like Create , Add comment, Update Comment ,Delete, Resolve , Add worklog and Notify to issue operations available through the Jira connector. Some of them are listed below:

  • Allows you to perform "RESTful" operations.
  • Create issue of type : Incident, Service Request, Problem, change with custom fields.
  • Add comment to an issue.
  • Update Comment.
  • Delete issue.
  • Resolve issue.
  • Add worklog to an issue.

Configuring Jira connector

add_jira_connector

Configuration parameters
ParameterDescriptionrequired
portPort on which Jira service desk runningtrue
host-nameOwn unique identifier or URI. If you want to access data from helpdesk you need this unique identifier or URI.true
is-sslIs your domain access secure web services.false
passwordPassword id associated with your Jira account.true
project-idId associated with project.true
user-nameUser name associated with your Jira account.true
Example
{
  "port":8080,
  "host-name":"localhost",
  "user-name":"admin",
  "password":"admin",
  "project-id":"10100",
  "is-ssl":false 
}

Actions

add-comment

Adds a new comment to an issue.

Request parameters
ParameterDescriptionrequired
actionaction to perform: add-commenttrue
commentComment texttrue
issue-idIssue idtrue
typefor which type of user you want to restrict comment e.g. rolefalse
valuevalue of the role e.g Administratorsfalse
Response parameters
ParameterDescriptionrequired
bodyResponse Body, Data related to issuetrue
Example
response=@call.connector("jira_connector_name")    
              .set("action","add-comment")
              .set("comment","Deploye tested code on server. ")
              .set("issue-id",1)
              .set("type","role")
              .set("value","Administrators")
              .sync

ticket_content = response.get("body")  #Response Result, ticket information from jira servicedesk.

create-issue

Create an issue.

Request parameters
ParameterDescriptionrequired
actionaction to perform: create-issuetrue
summaryTitle of issue.true
descriptionDescription related to issuefalse
issuetypeType of issue. i.e Service Request, incident, Problem or Changefalse
priorityPriority of issue. i.e. Highest=1, High=2, Medium=3, Low=4, Lowest=5true
componentsComponents idsfalse
labelsComponents labelsfalse
duedateDue date of issuefalse
reporterReporter of the issuefalse
assigneeAssignee of the isssuefalse
custom-fieldCustom fieldsfalse
Response parameters
ParameterDescriptionrequired
bodyResponse Body, Data related to issuetrue
Example
response = @call.connector("jira_connector_name")
                .set("action","create-issue")
                .set("summary","something wrong.")
                .set("description","System is not working properly.")
                .set("issuetype","Service Request")
                .set("priority","4")
                .set("components",["10106","10105"],
                .set("labels",["bugfix","blitz_test"])
                .set("duedate","2016-03-11")
                .set("reporter","Admin")
                .set("assignee","smith")
                .set("custom-field",[{"Operating System": "Ubuntu"})
                .sync

ticket_content = response.get("body")  #Response Result, ticket information from jira servicedesk.

get-user

Returns a user.

Request parameters
ParameterDescriptionrequired
actionaction to perform: get-usertrue
usernameUser nametrue
Response parameters
ParameterDescriptionrequired
bodyResponse Body, Data related to issuetrue
Example
response = @call.connector("jira_connector_name")
                .set("action","get-user")
                .set("username", "admin")
                .sync

ticket_content = response.get("body")  #Response Result, ticket information from jira servicedesk. 
Sample output
 {  
   "emailAddress":"test@gmail.com",
   "expand":"groups,applicationRoles",
   "avatarUrls":{  
      "48x48":"http://www.gravatar.com/avatar/848e5ac8fc938e2f7becbdac0e10baee?d=mm&s=48",
      "24x24":"http://www.gravatar.com/avatar/848e5ac8fc938e2f7becbdac0e10baee?d=mm&s=24",
      "16x16":"http://www.gravatar.com/avatar/848e5ac8fc938e2f7becbdac0e10baee?d=mm&s=16",
      "32x32":"http://www.gravatar.com/avatar/848e5ac8fc938e2f7becbdac0e10baee?d=mm&s=32"
   },
   "displayName":"Admin",
   "name":"admin",
   "self":"http://localhost:8080/rest/api/2/user?username=admin",
   "active":true,
   "timeZone":"Asia/Kolkata",
   "groups":{  
      "size":2,
      "items":[  

      ]
   },
   "locale":"en_IN",
   "key":"admin",
   "applicationRoles":{  
      "size":1,
      "items":[  

      ]
   }
}            

resolve-issue

Resolve issue.

Request parameters
ParameterDescriptionrequired
actionaction to perform:resolve-issuetrue
commentComment on issuefalse
issue-idIssue id to resolvetrue
Response parameters
ParameterDescriptionrequired
bodyResponse Body, Data related to issuetrue
Example
response = @call.connector("jira_connecor_name")
                .set("action","resolve-issue")
                .set("comment","Virtual machine provision done successfully")
                .set("issue-id","IT-76")
                .sync

ticket_content = response.get("body")  #Response Result, ticket information from jira servicedesk.

add-worklog

Add worklog to an issue.

Request parameters
ParameterDescriptionrequired
actionaction to perform: add-worklogtrue
commentComment on issuefalse
issue-idIssue id to resolvetrue
startedStarted timetrue
adjust-estimatePossible values for adjust estimate are: new,manual,auto and leavetrue
new-estimateProvide only when adjust-estimate is newtrue if adjust_estimate = "new"
reduce-byProvide only when adjust-estimate is manualtrue if adjust_estimate = "manual"
Response parameters
ParameterDescriptionrequired
bodyResponse Body, Data related to issuetrue
Example for adjust-estimate = "new"
response = @call.connector("jira_connecor_name")
                .set("action","add-worklog")
                .set("comment","Virtual machine provision done successfully")
                .set("issue-id","IT-76")
                .set("started","2015-10-07T00:32:50.877+0000")  
                .set("timeSpent","2d 3h")
                .set("adjust-estimate","new")
                .set("new-estimate", "2d")
                .sync
ticket_content = response.get("body")  #Response Result, ticket information from jira servicedesk. 
Example for adjust-estimate = "manual"
response = @call.connector("jira_connecor_name")
                .set("action","add-worklog")
                .set("comment","Virtual machine provision done successfully")
                .set("issue-id","IT-76")
                .set("started","2015-10-07T00:32:50.877+0000")  
                .set("timeSpent","2d 3h")
                .set("adjust-estimate","manual")
                .set("reduce-by", "3h")
                .sync

ticket_content = response.get("body")  #Response Result, ticket information from jira servicedesk.
Example for adjust-estimate = "leave"
response = @call.connector("jira_connecor_name")
                .set("action","add-worklog")
                .set("comment","Virtual machine provision done successfully")
                .set("issue-id","IT-76")
                .set("started","2015-10-07T00:32:50.877+0000")  
                .set("timeSpent","2d 3h")
                .set("adjust-estimate","leave")
                .sync

ticket_content = response.get("body")  #Response Result, ticket information from jira servicedesk. 
Example for adjust-estimate = "auto"
response = @call.connector("jira_connecor_name")
                .set("action","add-worklog")
                .set("comment","Virtual machine provision done successfully")
                .set("issue-id","IT-76")
                .set("started","2015-10-07T00:32:50.877+0000")  
                .set("timeSpent","2d 3h")
                .set("adjust-estimate","auto")
                .sync

ticket_content = response.get("body")  #Response Result, ticket information from jira servicedesk. 

notify

Sends a notification to the list or recipients defined in the request.

Request parameters
ParameterDescriptionrequired
actionaction to perform: notifytrue
bodyEmail bodytrue
subjectEmail subjecttrue
reporterif you want notify to reporterfalse
assigneeif you want notify to assigneefalse
watcherif you want to notify watcherfalse
votersif you want to notify votersfalse
Response parameters
ParameterDescriptionrequired
bodyResponse Body, Data related to issuetrue
Example
response = @call.connector("jira_connecor_name")
                .set("action","notify")
                .set("issue-id","IT-76")
                .set("body","Virtual machine start request is still in pending request.")
                .set("subject","Regarding virtual machine start action")
                .set("reporter",true)
                .set("assignee",true)
                .set("watcher",false)
                .set("voters",false)  
                .sync

ticket_content = response.get("body")  #Response Result, ticket information from jira servicedesk. 

Connector request error handling

Here is how you can handle the connector requests success or failures within your Flintbit. This would help you to take appropriate action if something failed.

 if response.exitcode == 0               # 0 is success.
  @log.info("success")
  # take action in case of success
else                                    # non zero means fail
  @log.error("fail")
  @log.error("Reason:" + response.message)     # get the reason of failure
  ## Take action in case of failure
end

On this page: