This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Projects in JIRA
The following operations are available for working with projects.Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with projects, see Sample configuration .
Operation | Description |
---|---|
Gets information about a project. | |
Gets all avatars available for a project that are visible to the current user. | |
Deletes an avatar from a project. | |
Gets all the components of a project. | |
Gets the issue types and their valid status values for a project. | |
Gets all the versions of a project. | |
Gets all the roles in a project. | |
Gets details on a specific role. | |
Gets a list of users that match the search string. | |
setActorsToRoleOfProject | Assigns users to a role in a project. |
Following is more information about these operations.
Getting information about a project
To get information about a specific project, use getProject
and specify the project key. This operation returns a JSON representation of the entire project, including name, ID, components, and more.
<jira.getProject> <projectIdOrKey>{$ctx:projectIdOrKey}</projectIdOrKey> <expand>{$ctx:expand}</expand> </jira.getProject>
Properties
- projectIdOrKey: The Identifier the project whose information you want to get.
- expand : The parameters to expand.
Sample request
Following is a sample REST/JSON request that can be handled by the getProject operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net", "projectIdOrKey":"TEST" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e3008
Getting avatars for a project
To get the avatars available for a specific project, use getAvatarsForProject
and specify the project key. This operation returns a JSON representation of the avatars, including their name, ID, and whether the avatar is currently selected for the project.
<jira.getAvatarsForProject> <projectIdOrKey>{$ctx:projectIdOrKey}</projectIdOrKey> </jira.getAvatarsForProject>
Properties
- projectIdOrKey: The Identifier the project whose information you want to get.
Sample request
Following is a sample REST/JSON request that can be handled by the getAvatarsForProject operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net", "projectIdOrKey":"TEST" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e3151
Deleting an avatar from a project
To delete an avatar from a project, use deleteAvatarForProject
and specify the project key and avatar ID.
<jira.deleteAvatarForProject> <projectIdOrKey>{$ctx:projectIdOrKey}</projectIdOrKey> <avatarId>{$ctx:avatarId}</avatarId> </jira.deleteAvatarForProject>
Properties
- projectIdOrKey: The Identifier the project whose information you want to get.
avatarId
: Identifies the avatar to delete.
Sample request
Following is a sample REST/JSON request that can be handled by the deleteAvatarForProject operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net", "projectIdOrKey":"TEST", "avatarId":"10412" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e3175
Getting components of a project
To get the components of a specific project, use getComponentsOfProject
and specify the project key. This operation returns a JSON representation of the components, including their name, ID, and avatars.
<jira.getComponentsOfProject> <projectIdOrKey>{$ctx:projectIdOrKey}</projectIdOrKey> </jira.getComponentsOfProject>
Properties
- projectIdOrKey: The Identifier the project whose information you want to get.
Sample request
Following is a sample REST/JSON request that can be handled by the getComponentsOfProject operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net", "projectIdOrKey":"TEST" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e3218
Getting statuses of a project
To get the statuses of a specific project, usegetStatusesOfProject
and specify the project key. This operation returns a JSON representation of each issue type in the project and their statuses.
<jira.getStatusesOfProject> <projectIdOrKey>{$ctx:projectIdOrKey}</projectIdOrKey> </jira.getStatusesOfProject>
Properties
- projectIdOrKey: The Identifier the project whose information you want to get.
Sample request
Following is a sample REST/JSON request that can be handled by the getStatusesOfProject operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net", "projectIdOrKey":"TEST" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e3031
Getting versions of a project
To get the versions of a specific project, use getVersionsOfProject and specify the project key. This operation returns a JSON representation of the list of versions in the project.
<jira.getVersionsOfProject> <projectIdOrKey>{$ctx:projectIdOrKey}</projectIdOrKey> </jira.getVersionsOfProject>
Properties
- projectIdOrKey: The Identifier the project whose information you want to get.
Sample request
Following is a sample REST/JSON request that can be handled by the getVersionsOfProject operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net", "projectIdOrKey":"TEST" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e3195
Getting roles of a project
To get the roles of a specific project, use getRolesOfProject
and specify the project key. This operation returns a JSON representation of the list of roles in the project, including each role's name and a link to more details.
<jira.getRolesOfProject> <projectIdOrKey>{$ctx:projectIdOrKey}</projectIdOrKey> </jira.getRolesOfProject>
Properties
projectKey
: The Identifier the project whose information you want to get.
Sample request
Following is a sample REST/JSON request that can be handled by the getRolesOfProject operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net", "projectIdOrKey":"TEST" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1710
Getting information on a role
To get information about a specific role, use getRolesByIdOfProject
and specify the project key and role ID. This operation returns a JSON representation of the role, including its name, ID, actors, and more.
<jira.getRolesByIdOfProject> <projectIdOrKey>{$ctx:projectIdOrKey}</projectIdOrKey> <roleId>{$ctx:roleId}</roleId> </jira.getRolesByIdOfProject>
Properties
- projectIdOrKey: The Identifier the project whose information you want to get.
roleId
: Identifies the role whose information you want to get.
Sample request
Following is a sample REST/JSON request that can be handled by the getRolesByIdOfProject operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net", "projectIdOrKey":"TEST", "roleId":"10001" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1731
Returns a list of users can be assigned issues for all the given projects
To get list of users that match the search string and can be assigned issues for all the given projects, use getUserAssignableProjects
<jira.getUserAssignableProjects> <projectKeys>{$ctx:projectKeys}</projectKeys> <usernameForSearch>{$ctx:usernameForSearch}</usernameForSearch> <maxResults>{$ctx:maxResults}</maxResults> <startAt>{$ctx:startAt}</startAt> </jira.getUserAssignableProjects>
Properties
- projectKeys : The keys of the projects we are finding assignable users for, comma-separated.
- usernameForSearch : The username for search.
- maxResults : The maximum number of users to return .
- startAt : The index of the first user to return .
Sample request
Following is a sample REST/JSON request that can be handled by the getUserAssignableProjects operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net", "projectKeys":"TEST", "usernameForSearch":"james" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e3973
Assigning users to a role
To assign one or more users to a specific role in a project, use setActorsToRoleOfProject
, specify the project key and role ID, and specify the users in the payload. You can specify individual users or groups.
<jira.setActorsToRoleOfProject> <projectIdOrKey>{$ctx:projectIdOrKey}</projectIdOrKey> <roleId>{$ctx:roleId}</roleId> <roles>{$ctx:roles}</roles> </jira.setActorsToRoleOfProject>
Properties
- projectIdOrKey: The Identifier the project whose information you want to get.
roleId
: Identifies the role whose information you want to get.- roles: The users who you want to assign.
Sample request
Following is a sample REST/JSON request that can be handled by the setActorsToRoleOfProject operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net", "projectIdOrKey":"TEST", "projectKey":"JAF", "roleId":"10000", "roles":{"user" :["James"]} }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1731
Sample Configuration
Following is a sample proxy service that illustrates how to connect to Jira with the init operation and use the setActorsToRoleOfProject
operation. The sample request for this proxy can be found in setActorsToRoleOfProject
sample request . You can use this sample as a template for using other operations in this category.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="setActorsToRoleOfProject" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <property name="username" expression="json-eval($.username)"/> <property name="password" expression="json-eval($.password)"/> <property name="uri" expression="json-eval($.uri)"/> <property name="projectIdOrKey" expression="json-eval($.projectIdOrKey)"/> <property name="roleId" expression="json-eval($.roleId)"/> <property name="roles" expression="json-eval($.roles)"/> <jira.init> <username>{$ctx:username}</username> <password>{$ctx:password}</password> <uri>{$ctx:uri}</uri> </jira.init> <jira.setActorsToRoleOfProject> <projectIdOrKey>{$ctx:projectIdOrKey}</projectIdOrKey> <roleId>{$ctx:roleId}</roleId> <roles>{$ctx:roles}</roles> </jira.setActorsToRoleOfProject> <log level="full"/> <respond/> </inSequence> <outSequence/> <faultSequence/> </target> <description/> </proxy>