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

OperationDescription

createComponent

Creates a component.

getComponent

Retrieves a project component.

updateComponentModifies a component.
countComponentRelatedIssuesRetrieves 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. 

createComponent
<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
  • name: The name of the component.
  • project: The key of the project, the component should be belong to.
  • description: The description for the component.
  • leadUserName: The key of the lead user name.
  • assigneeType: The type of the assignee.
  • isAssigneeTypeValid: A Boolean which specifies whether the assignee type is valid or not.
   Sample request

Following is a sample REST/JSON request that can be handled by the createComponent operation.

Sample Request for createComponent
{
    "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 getComponent operation retrieves a project component.

getComponent
<jira.getComponent>
	<componentId>{$ctx:componentId}</componentId>
</jira.getComponent>
Properties
  • componentId: The unique identifier for a particular component.
   Sample request

Following is a sample REST/JSON request that can be handled by the getComponent operation.

Sample Request for getComponent
{
    "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 updateComponent 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
  • componentId: The unique identifier for a particular component.
  • name: The name of the component.
  • description: The description for the component.
  • leadUserName: The key of the lead username.
  • assigneeType: The type of the assignee.
  • isAssigneeTypeValid: A Boolean which specifies whether the assignee type is valid or not.
   Sample request

Following is a sample REST/JSON request that can be handled by the updateComponent operation.

Sample Request for updateComponent
{
    "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 countComponentRelatedIssues operation retrieves counts of issues related to this component.

countComponentRelatedIssues
<jira.countComponentRelatedIssues>
	<componentId>{$ctx:componentId}</componentId>
</jira.countComponentRelatedIssues>
Properties
  • componentId: The unique identifier for a particular component.
   Sample request

Following is a sample REST/JSON request that can be handled by the countComponentRelatedIssues operation.

Sample Request for countComponentRelatedIssues
{
    "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.

Sample Proxy
<?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>