The Jira pack provides the ability to create issues, comment on issues and to get info about issues.
To build and run from the command line:
- Clone this repo
- Run
go build
- Run
FLYTE_API_URL=http://.../ JIRA_HOST=https://... JIRA_USER=... JIRA_PASSWORD=... ./flyte-jira
- Fill in this command with the relevant API url, Jira host, Jira user and Jira password environment variables
To build and run from docker
- Run
docker build -t flyte-jira .
- Run
docker run -e FLYTE_API_URL=http://.../ -e JIRA_HOST=https://... -e JIRA_USER=... -e JIRA_PASSWORD=... flyte-jira
- All of these environment variables need to be set
This pack provides three commands: CommentIssue
, IssueInfo
and CreateIssue
.
This command returns information about a specific issue.
This commands input is the id of the desired issue:
"input" : "TEST-123",
This command can either return an Info
event or an InfoFailure
event.
This is the success event, it contains the Id, Summary, Status, Description and Assignee. It returns them in the form:
"payload": {
"id": "TEST-123",
"summary": "Fix client race condition",
"status": "In Progress",
"description": "The client experiences.....",
"assignee": "jsmith",
}
This contains the id of the issue and the error.
"payload": {
"id" : "TEST-123",
"error": "Could not get info on TEST-123: status code 400",
}
This command creates a Jira issue.
This commands input is the project the issue should be created under, the issue type and the title.
"input": {
"project": "TEST",
"issue_type": "Story",
"title": "Fix csetcd bug"
}
This command can return either a CreateIssue
event or a CreateIssueFailure
event.
This is the success event, it contains the id of the issue and the url of the issue along with the input(project, issue_type & title) It returns them in the form:
"payload": {
"id": "TEST-123",
"url": "https://localhost:8100/browse/TEST-123",
"project": "TEST",
"issue_type": "Story",
"title": "Fix csetcd bug"
}
This contains the error if the issue cannot be created along with the input (project, issue_type & title):
"payload": {
"error": "Cannot create issue: Fix csetcd bug: status code 400",
"project": "TEST",
"issue_type": "Story",
"title": "Fix csetcd bug"
}
This command comments on an issue.
This commands input is the id of the issue and the comment to be added.
"input": {
"id": "TEST-123",
"comment": "Added to backlog"
}
This command can return either a Comment
event or a CommentFailure
event.
This is the success event, it contains the id of the issue, the comment and the status. Status is the status code returned when a comment is left successfully.
"payload": {
"id": "TEST-123",
"comment": "Added to backlog"
}
This returns the error if a issue cannot be commented on successfully. It contains, the issue id, the comment and the error:
"payload": {
"id": "TEST-123",
"comment": "Added to backlog",
"error": "Could not comment on issue: status code 400"
}
This command searches issues using JQL queries.
This command's inputs are the query string, the index of the first element to be retrieved in the list of results and the number of elements to be retrieved.
"input": {
"query": "project = Flyte", // required
"startIndex": 0, // optional, default: 0
"maxResults": 10 // optional, default: 10
}
This command can return either a SearchSuccess
event or a SearchFailure
event.
This is the success event, it contains the values given as input for the command, the total number of possible results and the issues retrieved.
"payload": {
"query": "project = Flyte",
"startIndex": 0,
"maxResults": 10,
"total": 85,
"issues":[
{
"id": "TEST-123",
"summary": "Fix client race condition",
"status": "In Progress",
"description": "The client experiences.....",
"assignee": "jsmith",
}
...
]
}
This returns the error if the jql query is not valid. It contains the values given as input for the command and the error:
"payload": {
"query": "project = Flyte",
"startIndex": 0,
"maxResults": 10,
"error": "Could not search for issues: statusCode=400"
}