General information

Since v. 1.7.0 - changes in supported endpoint URLs - JIRA_URL/rest/*

note

Available for:

  • JIRA administrator - includes all of the following REST API:

    • JIRA_URL/rest/*

  • dedicated user groups (since v. 1.7.0 - please check REST API Configuration page)

Available for:

  • JIRA administrator - includes all of the following REST API:

    • JIRA_URL/rest/*

  • dedicated user groups (since v. 1.7.0 - please check REST API Configuration page)


How it’s works

It’s simple, just add into REST API request new header parameter contextUser containing username in the context of which we want to execute REST API.


CURL example

See how use contextUser in unix curl command

curl -u admin:admin -H "Content-Type: application/json" -H "contextUser: user" --data '{"body":"REST API Extender works good :) - CURL Example"}' -X POST http://localhost:2990/jira/rest/api/2/issue/PROJA-1/comment
"self":"http://localhost:2990/jira/rest/api/2/issue/10000/comment/10102","id":"10102","author":{"self":"http://localhost:2990/jira/rest/api/2/user?username=user","name":"user","key":"JIRAUSER10100","emailAddress":"user@jira.user.pl","avatarUrls":{"48x48":"https://www.gravatar.com/avatar/34c897cf89d2c13ed8dad7ca51ea0edf?d=mm&s=48","24x24":"https://www.gravatar.com/avatar/34c897cf89d2c13ed8dad7ca51ea0edf?d=mm&s=24","16x16":"https://www.gravatar.com/avatar/34c897cf89d2c13ed8dad7ca51ea0edf?d=mm&s=16","32x32":"https://www.gravatar.com/avatar/34c897cf89d2c13ed8dad7ca51ea0edf?d=mm&s=32"},"displayName":"user","active":true,"timeZone":"Europe/Warsaw"},"body":"test","updateAuthor":{"self":"http://localhost:2990/jira/rest/api/2/user?username=user","name":"user","key":"JIRAUSER10100","emailAddress":"user@jira.user.pl","avatarUrls":{"48x48":"https://www.gravatar.com/avatar/34c897cf89d2c13ed8dad7ca51ea0edf?d=mm&s=48","24x24":"https://www.gravatar.com/avatar/34c897cf89d2c13ed8dad7ca51ea0edf?d=mm&s=24","16x16":"https://www.gravatar.com/avatar/34c897cf89d2c13ed8dad7ca51ea0edf?d=mm&s=16","32x32":"https://www.gravatar.com/avatar/34c897cf89d2c13ed8dad7ca51ea0edf?d=mm&s=32"},"displayName":"user","active":true,"timeZone":"Europe/Warsaw"},"created":"2019-11-01T15:10:25.658+0100","updated":"2019-11-01T15:10:25.658+0100"}

Postman example

See how use contextUser in Postman

{
    "self": "http://localhost:2990/jira/rest/api/2/issue/10000/comment/10125",
    "id": "10125",
    "author": {
        "self": "http://localhost:2990/jira/rest/api/2/user?username=user",
        "name": "user",
        "key": "user",
        ...
    },
    "body": "REST API Extender works good :)",
    "updateAuthor": {
        "self": "http://localhost:2990/jira/rest/api/2/user?username=user",
        "name": "user",
        "key": "user",
        "emailAddress": "user@user.user",
        ...
    },
    "created": "2017-08-04T20:50:23.351+0200",
    "updated": "2017-08-04T20:50:23.351+0200"
}