Update Commit Issue Changes

Updates the list of issues associated with the commit to the specified repository.

There are two types of users who can perform the Get Commit Issue Changes API call:

  1. Jira administrators

  2. Jira user who has all of the following:

    1. View/browse permissions to the project;

    2. View Development Tools permissions to the same project; and

    3. The repository is associated to the project.

Update Commit Issue Changes

url

http://<jira-host>/rest/gitplugin/1.0/repository/{repoId}/commits/{commitHash}/issues

method

POST

parameters

Parameter

Condition

jira-host

String. Required.

This is the default url location where you host your Jira.

For example:

http://local-host-jira.com:2990

https://jira.your-organization.com

repoId

Integer. Required.

Substitute {repoId} with the actual repository ID.

Use the Repository REST API to obtain the connected repositories' IDs.

Example:

http://local-host-jira.com:2990/rest/gitplugin/1.0/repository/1/commit/e012663bf9bd968388faa510cb5b310e4798c512/issues

In the case of the above example, the commit association(s) of the specified commit hash and repository will be updated using the parameters specified in the JSON request body. See changeStrs parameter.

commitHash

String. Required.

This is the hash of the commit that you want the results from.

Example:  e012663bf9bd968388faa510cb5b310e4798c512

changeStrs

The request body is a JSON structure supporting the following parameters:

Parameter

Description

a

Adds a new issue key to associate to the commit.

d

Disassociate the specified issue key from the commit.

 

Example request:

1 2 3 { "changeStrs": ["d:TST-5", "a:TST-6", "a:TST-7"] }

response

Returns the result for the example below.

Example for POST queries:

1 2 3 4 5 6 7 POST /jira/rest/gitplugin/1.0/repository/1/commits/e012663bf9bd968388faa510cb5b310e4798c512/issues HTTP/1.1 Host: localhost:2990 Content-Type: application/json { "changeStrs": ["d:TST-5", "a:TST-6", "a:TST-7"] }

The changeStrs modifier with the specified parameters will give the following result:

1 2 Removes association of TST-5; and associates TST-6 and TST-7 to the same commit in repo1 and repo2.