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 Groups in JIRA

The following operation is available for working with groups.Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with groups, see Sample configuration .

OperationDescription
getGroupGets all available Jira groups.
listGroupPickerRetrieves groups with substrings matching a given query.
listGroupUserPickerRetrieves a list of users and groups matching query with highlighting. 

Following is more information about these operations.

Getting group

This operation returns a JSON representation of the list of groups, including their names, IDs, and more.

getGroup
<jira.getGroup>
	<groupName>{$ctx:groupName}</groupName>
    <expand>{$ctx:expand}</expand>
</jira.getGroup>
Properties
  • groupName: The name of the group.
  • expand : The parameters to expand.
Sample request

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

Sample request for getGroup
{
    "username":"admin",
    "password":"jira@jaffna",       
    "uri":"https://testcon.atlassian.net",        
    "groupName":"administrators",
    "expand":"users"
}
Related Jira Documentation

https://developer.atlassian.com/static/rest/jira/6.1.html#d2e2900

Retrieving groups with substrings matching a given query 

This operation retrieves groups with substrings matching a given query. 

listGroupPicker
<jira.listGroupPicker>
    <query>{$ctx:query}</query>
    <exclude>{$ctx:exclude}</exclude>
	<maxResults>{$ctx:maxResults}</maxResults>
</jira.listGroupPicker>
Properties
  • query: The query to match groups against.
  • exclude: The exclude from the result.
  • maxResults: The max results to return.
Sample request

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

Sample request for listGroupPicker
{
  "uri": "https://testappmahesh.atlassian.net",
  "username": "admin",
  "password": "1qaz2wsx@",
  "query": "administrators",
  "exclude": "system-administrators",
  "maxResults": "2"
}
Related Jira Documentation

https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1689

Retrieving a list of users and groups matching query with highlighting 

This operation retrieves a list of users and groups matching query with highlighting.

listGroupUserPicker
<jira.listGroupUserPicker>
    <query>{$ctx:query}</query>
    <maxResults>{$ctx:maxResults}</maxResults>
	<isShowAvatar>{$ctx:isShowAvatar}</isShowAvatar>
</jira.listGroupUserPicker>
Properties
  • query: A string used to search username, Name or e-mail address.
  • maxResults: The maximum number of users to return.
  • isShowAvatar: The boolean value to show avatar.
Sample request

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

Sample request for listGroupUserPicker
{
  "uri": "https://testappmahesh.atlassian.net",
  "username": "admin",
  "password": "1qaz2wsx@",
  "query": "admin",
  "maxResults": "1",
  "isShowAvatar": "true"
}
Related Jira Documentation

https://developer.atlassian.com/static/rest/jira/6.1.html#d2e776

Sample Configuration

Following is a sample proxy service that illustrates how to connect to Jira with the init operation and use the getGroup operation. The sample request for this proxy can be found in getGroup sample request . You can use this sample as a template for using other operations in this category.

Sample proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="getGroup"
       transports="https http"
       startOnLoad="true"
       trace="disable">
   <description/>
   <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="groupName" expression="json-eval($.groupName)"/>
         <property name="expand" expression="json-eval($.expand)"/>
         <jira.init>
            <username>{$ctx:username}</username>
            <password>{$ctx:password}</password>
            <uri>{$ctx:uri}</uri>
         </jira.init>
         <jira.getGroup>
            <groupName>{$ctx:groupName}</groupName>
        <expand>{$ctx:expand}</expand>
         </jira.getGroup>
         <log level="full"/>
         <respond/>
      </inSequence>
      <outSequence/>
      <faultSequence/>
   </target>
</proxy>