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 Components in JIRA
Overview
The following operations allow you to work with components. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with components, see Sample configuration.
Operation | Description |
---|---|
Creates a component. | |
getComponent | Retrieves a project component. |
updateComponent | Modifies a component. |
countComponentRelatedIssues | Retrieves counts of issues related to this component. |
Operation details
This section provides further details on the operations related to components.
Creating a component
The createComponent operation creates a component.
<jira.createComponent> <name>{$ctx:name}</name> <project>{$ctx:project}</project> <description>{$ctx:description}</description> <leadUserName>{$ctx:leadUserName}</leadUserName> <assigneeType>{$ctx:assigneeType}</assigneeType> <isAssigneeTypeValid>{$ctx:isAssigneeTypeValid}</isAssigneeTypeValid> </jira.createComponent>
Properties
The name of the component.name:
The key of the project, the component should be belong to.project:
The description for the component.description:
The key of the lead user name.leadUserName:
The type of the assignee.assigneeType:
A Boolean which specifies whether the assignee type is valid or not.isAssigneeTypeValid:
Sample request
Following is a sample REST/JSON request that can be handled by the createComponent
operation.
{ "uri": "https://connector.atlassian.net", "username": "admin", "password": "1qaz2wsx@", "name": "testing component1", "project": "TESTPM1", "description": "test description", "leadUserName": "admin", "assigneeType": "PROJECT_LEAD", "isAssigneeTypeValid": "false" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/5.0.html#id197647
Retrieving a project component
The
operation retrieves a project component.getComponent
<jira.getComponent> <componentId>{$ctx:componentId}</componentId> </jira.getComponent>
Properties
The unique identifier for a particular component.componentId:
Sample request
Following is a sample REST/JSON request that can be handled by the getComponent
operation.
{ "uri": "https://connector.atlassian.net", "username": "admin", "password": "1qaz2wsx@", "componentId": "10120" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/5.0.html#id197800
Modifying a component
The
operation modifies a component.updateComponent
<jira.updateComponent> <componentId>{$ctx:componentId}</componentId> <name>{$ctx:name}</name> <description>{$ctx:description}</description> <leadUserName>{$ctx:leadUserName}</leadUserName> <assigneeType>{$ctx:assigneeType}</assigneeType> <isAssigneeTypeValid>{$ctx:isAssigneeTypeValid}</isAssigneeTypeValid> </jira.updateComponent>
Properties
The unique identifier for a particular component.componentId:
The name of the component.name:
The description for the component.description:
The key of the lead username.leadUserName:
The type of the assignee.assigneeType:
A Boolean which specifies whether the assignee type is valid or not.isAssigneeTypeValid:
Sample request
Following is a sample REST/JSON request that can be handled by the updateComponent
operation.
{ "uri": "https://connector.atlassian.net", "username": "admin", "password": "1qaz2wsx@", "componentId": "10109", "name": "testing component1", "description": "test description", "leadUserName": "admin", "assigneeType": "PROJECT_LEAD", "isAssigneeTypeValid": "false" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/5.0.html#id197853
Retrieving counts of issues
The
operation retrieves counts of issues related to this component.countComponentRelatedIssues
<jira.countComponentRelatedIssues> <componentId>{$ctx:componentId}</componentId> </jira.countComponentRelatedIssues>
Properties
The unique identifier for a particular component.componentId:
Sample request
Following is a sample REST/JSON request that can be handled by the countComponentRelatedIssues
operation.
{ "uri": "https://connector.atlassian.net", "username": "admin", "password": "1qaz2wsx@", "componentId": "10109" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/5.0.html#id197913
Sample configuration
Following is a sample proxy service that illustrates how to connect to JIRA with the init
operation and use the createComponent
operation. The sample request for this proxy can be found in the createComponent sample request.
<?xml version="1.0" encoding="UTF-8"?> <proxy name="jira_createComponent" startOnLoad="true" statistics="disable" trace="disable" transports="https" xmlns="http://ws.apache.org/ns/synapse"> <target> <inSequence onError="faultHandlerSeq"> <property name="uri" expression="json-eval($.uri)"/> <property name="username" expression="json-eval($.username)"/> <property name="password" expression="json-eval($.password)"/> <property name="name" expression="json-eval($.name)"/> <property name="project" expression="json-eval($.project)"/> <property name="description" expression="json-eval($.description)"/> <property name="leadUserName" expression="json-eval($.leadUserName)"/> <property name="assigneeType" expression="json-eval($.assigneeType)"/> <property name="isAssigneeTypeValid" expression="json-eval($.isAssigneeTypeValid)"/> <jira.init> <uri>{$ctx:uri}</uri> <username>{$ctx:username}</username> <password>{$ctx:password}</password> </jira.init> <jira.createComponent> <name>{$ctx:name}</name> <project>{$ctx:project}</project> <description>{$ctx:description}</description> <leadUserName>{$ctx:leadUserName}</leadUserName> <assigneeType>{$ctx:assigneeType}</assigneeType> <isAssigneeTypeValid>{$ctx:isAssigneeTypeValid}</isAssigneeTypeValid> </jira.createComponent> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>