Atlassian Jira v2

Use the Atlassian Jira v2 integration to manage issues and create Demisto incidents from projects.

This integration was integrated and tested with version 1001.0.0-SNAPSHOT of Jira. For more information about manage syntax, see the https://support.atlassian.com/

Use Cases


  1. Create, edit, delete, and query Jira issues.
  2. Get or add issue’s comments.
  3. Add link and upload an attachment to issue.

Configure jira-v2 on Demisto


  1. Navigate to Settings > Integrations > Servers & Services.
  2. Search for Jira v2.
  3. Click Add instance to create and configure a new integration instance.

Username__

* __Password (Deprecated - Use API token)__
* __API token__
* ____________________ OAuth 1.0 __________________

For OAuth: See the https://developer.atlassian.com/server/jira/platform/oauth/

ConsumerKey__

* __AccessToken__
* __PrivateKey__
* __Query (in JQL) for fetching incidents__
* __Issue index to start fetching incidents from__
* __Trust any certificate (not secure)__
* __Use system proxy settings__
* __Fetch incidents__
* __Incident type__
* __Use created field to fetch incidents__
  1. Click Test to validate the URLs, token, and connection.

Fetched Incidents Data


When you enable fetched incidents, Demisto fetches the first batch of Jira issues from the 10 minutes prior to when the integration was added. After the first batch of fetched issues, Demisto fetches new Jira issues as soon as they are generated in Jira. By default, 50 issues are pulled for each call. To pull older Jira issues, use the query to fetch issues option.

Commands


You can execute these commands from the Demisto CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.

  1. Search Jira issues: jira-issue-query
  2. Fetch an issue: jira-get-issue
  3. Create an issue: jira-create-issue
  4. Upload a file to an issue: jira-issue-upload-file
  5. Add a comment to an issue: jira-issue-add-comment
  6. Create (or update) a link to an issue: jira-issue-add-link
  7. Edit an issue: jira-edit-issue
  8. Get a ticket's comments: jira-get-comments
  9. Delete an issue: jira-delete-issue
  10. Get the ID offset: jira-get-id-offset

1. Search Jira issues


Queries Jira issues.

Base Command

jira-issue-query

Input
Argument NameDescriptionRequired
queryThe JQL query string.Required
startAtThe index (integer) of the first issue to return (0-based).Optional
maxResultsThe maximum number of issues to return (default is 50). The maximum allowed value is dictated by the JIRA property 'jira.search.views.default.max'. If you specify a value that is higher than this number, your search results will be truncated.Optional
headersThe headers to display in human readable format.Optional
Context Output
PathTypeDescription
Ticket.IdUnknownThe ID of the ticket.
Ticket.KeyUnknownThe key of the ticket.
Ticket.AssigneeUnknownThe user assigned to the ticket.
Ticket.CreatorUnknownThe user who created the ticket.
Ticket.SummaryUnknownThe summary of the ticket.
Ticket.StatusUnknownThe status of the ticket.
Command Example

!jira-issue-query query="status=done"

Context Example
{
"Ticket": [
{
"Status": "Done",
"Creator": "{creator}",
"Summary": "HelloBlocked11",
"Assignee": "null(null)",
"Key": "TES-25",
"Id": "12658"
},
{
"Status": "Done",
"Creator": "{creator}",
"Summary": "Test2",
"Assignee": "null(null)",
"Key": "SOC-40",
"Id": "10986"
}
]
}
Human Readable Output

jira-issue-query

assigneecreatedcreatordescriptionduedateidissueTypekeylabelspriorityprojectreporterstatussummaryticket_link
null(null)2019-05-04T02:45:09.909+0300{creator}TypeofIssueIdList12658A task that needs to be done.TES-25Mediumtest1{creator}DoneHelloBlocked11https://demistodev.atlassian.net/rest/api/latest/issue/12658
null(null)2019-01-27T15:59:03.134+0200{creator}10986jira.translation.issuetype.bug.name.descSOC-40MediumSOC{creator}DoneTest2https://demistodev.atlassian.net/rest/api/latest/issue/10986

2. Fetch an issue


Fetches an issue from Jira.

Base Command

jira-get-issue

Input
Argument NameDescriptionRequired
issueIdThe ID of the issue.Required
headersHeaders to display in human readable format.Optional
getAttachmentsIf "true", retrives the issue's attachments.Optional
expandLinksIf "true", expands the issue's links.Optional
Context Output
PathTypeDescription
Ticket.IdUnknownThe ID of the ticket.
Ticket.KeyUnknownThe key of ticket.
Ticket.AssigneeUnknownThe user assigned to the ticket.
Ticket.CreatorUnknownThe user who created the ticket.
Ticket.SummaryUnknownThe summary of the ticket.
Ticket.StatusUnknownThe status of the ticket.
File.SizeUnknownThe size of the file.
File.SHA256UnknownThe SHA256 hash of the file.
File.NameUnknownThe name of the file.
File.SHA1UnknownThe SHA1 hash of the file.
Command Example

!jira-get-issue issueId=15572 getAttachments=true

Context Example
{
"Ticket": [
{
"Status": "To Do",
"Creator": "{creator}",
"Summary": "Test issue23",
"Assignee": "{assignee}",
"attachment": "",
"Key": "DEM-5415",
"Id": "15572"
}
]
}
Human Readable Output

jira-get-issue

assigneeattachmentcreatedcreatordescriptionduedateidissueTypekeylabelspriorityprojectreporterstatussummaryticket_link
null(null)2020-01-19T12:34:13.784+0200{creator}lala15572Request for ActionDEM-5415Mediumdemistodev{assignee}To DoTest issue23https://demistodev.atlassian.net/rest/api/latest/issue/15572

3. Create an issue


Creates a new issue in Jira.

Base Command

jira-create-issue

Input
Argument NameDescriptionRequired
issueJsonThe issue object (in JSON format).Optional
summaryThe summary of the issue.Required
projectKeyThe project key with which to associate the issue.Optional
issueTypeNameSelect an issue type by name, for example: "Problem".Optional
issueTypeIdSelect an issue type by its numeric ID.Optional
projectNameThe project name with which to associate the issue.Optional
descriptionA description of the issue.Optional
labelsA CSV list of labels.Optional
priorityThe priority name, for example: "High" or "Medium".Optional
dueDateThe due date for the issue (in the format: 2018-03-11).Optional
assigneeThe name of the assignee.Optional
reporterThe ID of the reporter.Optional
parentIssueKeyThe parent issue key (if you create a sub-task).Optional
parentIssueIdThe parent issue ID (if you create a sub-task).Optional
Context Output
PathTypeDescription
Ticket.IdUnknownThe ID of the ticket.
Ticket.KeyUnknownThe key of the ticket.
Command Example

``!jira-create-issue summary="test SOC issue26" projectKey=DEM issueJson={"fields":{"issuetype":{"name":"Request for Action"}}}````

Context Example
{
"Ticket": [
{
"Id": "15576",
"Key": "DEM-5419"
}
]
}
Human Readable Output

jira-create-issue

idkeyprojectKeyself
15576DEM-5419DEMhttps://demistodev.atlassian.net/rest/api/latest/issue/15576

4. Upload a file to an issue


Uploads a file attachment to an issue.

Base Command

jira-issue-upload-file

Input
Argument NameDescriptionRequired
issueIdThe ID of the issue.Required
uploadThe entry ID to upload.Optional
attachmentNameThe attachment name to be displayed in Jira (overrides original file name)Optional
Context Output

There is no context output for this command.

Command Example

!jira-issue-upload-file issueId=15572 upload=19@75

Human Readable Output

jira-issue-upload-file

attachment_linkattachment_nameidissueId
https://demistodev.atlassian.net/rest/api/2/attachment/13456jira_v2_yml.yml1345615572

5. Add a comment to an issue


Adds a new comment to an existing Jira issue.

Base Command

jira-issue-add-comment

Input
Argument NameDescriptionRequired
issueIdThe ID of the issue.Required
commentThe comment body.Required
visibilityThe roles that can view the comment, for example: "Administrators".Optional
Context Output

There is no context output for this command.

Command Example

!jira-issue-add-comment issueId=15572 comment="test comment"

Human Readable Output

jira-issue-add-comment

commentidkeyticket_link
test comment13779adminhttps://demistodev.atlassian.net/rest/api/2/issue/15572/comment/13779

6. Create (or update) a link to an issue


Creates (or updates) an issue link.

Base Command

jira-issue-add-link

Input
Argument NameDescriptionRequired
globalIdIf a globalId is provided, and a remote issue link exists with that globalId, the remote issue link is updated.Optional
relationshipThe object relationship to issue, for example: "causes".Optional
urlThe URL link.Required
titleThe title of the link.Required
summaryThe summary of the link.Optional
issueIdThe ID of the issue.Required
applicationTypeThe application type of the linked remote application. E.g "com.atlassian.confluence".Optional
applicationNameThe application name of the linked remote application. E.g "My Confluence Instance".Optional
Context Output

There is no context output for this command.

Command Example

!jira-issue-add-link issueId=15572 title=test url=https://www.demisto.com/

Human Readable Output

jira-issue-add-link

idticket_link
13722https://demistodev.atlassian.net/rest/api/latest/issue/DEM-5415/remotelink/13722

7. Edit an issue


Modifies an issue in JIRA.

Base Command

jira-edit-issue

Input
Argument NameDescriptionRequired
issueIdThe ID of the issue to edit.Required
issueJsonThe issue object (in JSON format). e.g, {"fields":{"customfield_10037": "field_value"}}Optional
summaryThe summary of the issue.Optional
descriptionThe description of the issue.Optional
labelsA CSV list of labels.Optional
priorityA priority name, for example "High" or "Medium".Optional
dueDateThe due date for the issue (in the format 2018-03-11).Optional
assigneeThe name of the assignee.Optional
statusThe name of the status.Optional
Context Output
PathTypeDescription
Ticket.IdUnknownThe ID of the ticket.
Ticket.KeyUnknownThe key of the ticket.
Ticket.AssigneeUnknownThe user assigned to the ticket.
Ticket.CreatorUnknownThe user who created the ticket.
Ticket.SummaryUnknownThe summary of the ticket.
Ticket.StatusUnknownThe status of the ticket.
Command Example

!jira-edit-issue issueId=15572 customFields=Type_of_incident:Malware(Virus,_Ransomware) description="Just a description"

Context Example
{
"Ticket": [
{
"Status": "To Do",
"Creator": "{creator}",
"Summary": "Test issue23",
"Assignee": "{assignee}",
"attachment": "test_file.yml",
"Key": "DEM-5415",
"Id": "15572"
}
]
}
Human Readable Output

jira-edit-issue

assigneeattachmentcreatedcreatordescriptionduedateidissueTypekeylabelspriorityprojectreporterstatussummaryticket_link
{assignee}test_file.yml2020-01-19T12:34:13.784+0200{creator}Just a description15572Request for ActionDEM-5415Mediumdemistodev{reporter}To DoTest issue23https://demistodev.atlassian.net/rest/api/latest/issue/15572

Issue #15572 was updated successfully

8. Get a ticket's comments


Returns the comments added to a ticket.

Base Command

jira-get-comments

Input
Argument NameDescriptionRequired
issueIdThe ID of the issue from which to get the comments.Required
Context Output
PathTypeDescription
Ticket.Comment.CommentstringThe text of the comment.
Ticket.Comment.CreatedstringThe issue creation date.
Ticket.Comment.UserstringThe user that created the comment.
Command Example

!jira-get-comments issueId=15572

Context Example
{
"Ticket": {
"Comment": [
{
"Comment": "test comment",
"User": "admin",
"Created": "2020-01-19T12:35:49.194+0200"
}
],
"Id": "15572"
}
}
Human Readable Output

Comments

CommentCreatedUser
test comment2020-01-19T12:35:49.194+0200admin

9. Delete an issue


Deletes an issue in Jira.

Base Command

jira-delete-issue

Input
Argument NameDescriptionRequired
issueIdOrKeyThe ID or key of the issue.Required
Context Output

There is no context output for this command.

Command Example

!jira-delete-issue issueIdOrKey=DEM-5415

Human Readable Output

Issue deleted successfully.

10. Get the ID offset


Returns the ID offset, for example, the first issue ID.

Base Command

jira-get-id-offset

Input

There are no input arguments for this command.

Context Output
PathTypeDescription
Ticket.idOffSetstringThe ID offset.
Command Example

!jira-get-id-offset

Context Example
{
"Ticket.idOffSet": "10161"
}
Human Readable Output

ID Offset: 10161