public class

JiraConnector

extends Object
java.lang.Object
   ↳ org.mule.module.jira.JiraConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

JIRA is a proprietary issue tracking product, developed by Atlassian, commonly used for bug tracking, issue tracking, and project management.

Summary

Constants
String MULTIVALUED_FIELD_SEPARATOR
Fields
private JiraClient<List<Object>> client
private String connectionAddress
private String connectionUser
private Calendar customFieldsCacheExpiration
private Map<String, String> customFieldsNamesToIdsMapping
private String token
private Boolean useCustomFieldsExternalName if external custom fields names (instead of internal ids) are used when modifying custom fields, the provided user must be a Jira administrator in order to be able to use this feature
Public Constructors
JiraConnector()
Public Methods
void addActorsToProjectRole(List<String> actors, Long projectRoleId, String projectKey, String actorType)
Adds the given actors to the project role.
boolean addBase64EncodedAttachmentsToIssue(String issueKey, List<String> fileNames, List<String> base64EncodedAttachmentData)
An alternative mechanism for adding attachments to an issue.
void addComment(String issueKey, String commentAuthor, String commentBody, String commentGroupLevel, String commentRoleLevel)
Adds a new comment to the issue.
void addDefaultActorsToProjectRole(List<String> actors, Long projectRoleId, String type)
Adds the default actors to the project role denoted by this id.
RemotePermissionScheme addPermissionTo(String permissionSchemeName, Long permissionCode, String entityName)
Adds the permission to the given entity name (username or group name)

void addUserToGroup(String groupName, String userName)
Adds a user to the given group name.
RemoteVersion addVersion(String projectKey, String versionName, Boolean archived, Boolean released, String releaseDate)
Adds a new version

RemoteWorklog addWorklogAndAutoAdjustRemainingEstimate(String issueKey, String timeSpent, String startDate, String comment, String groupLevel, String roleLevelId)
Adds a worklog to the given issue.
RemoteWorklog addWorklogAndRetainRemainingEstimate(String issueKey, String timeSpent, String startDate, String comment, String groupLevel, String roleLevelId)
Adds a worklog to the given issue but leaves the issue's remaining estimate field unchanged.
RemoteWorklog addWorklogWithNewRemainingEstimate(String issueKey, String timeSpent, String startDate, String newRemainingEstimate, String comment, String groupLevel, String roleLevelId)
Adds a worklog to the given issue and sets the issue's remaining estimate field to the given value.
void archiveVersion(String projectKey, String versionName, Boolean archive)
Archieves the given version/

void connect(String connectionUser, String connectionPassword, String connectionAddress)
Creates a connection to Jira by making a login call with the given credentials to the specified address.
RemoteGroup createGroup(String groupName, String userName)
Creates a group with the given name optionally adding the given user to it.
RemoteIssue createIssue(String assignee, String summary, String description, String dueDate, String environment, String priority, String project, String reporter, String type, Long votes, Map<String, String> customFields, String componentName, String componentId)
Creates an issue.
RemoteIssue createIssueUsingObject(RemoteIssue issue)
Creates an issue.
RemoteIssue createIssueWithSecurityLevel(String assignee, String summary, String description, String dueDate, String environment, String priority, String project, String reporter, String type, Long votes, Map<String, String> customFields, Long securityLevelId, String componentName, String componentId)
Creates an issue using the the security level denoted by the given id.
RemotePermissionScheme createPermissionScheme(String name, String description)
Creates a new permission schema using the given name and description.
RemoteProject createProject(String key, String name, String description, String url, String lead, String permissionSchemeName, String notificationSchemeName, String securityShemeName)
Creates a new project

RemoteProjectRole createProjectRole(String projectRoleName, String projectRoleDescription)
Creates a new project role.
RemoteUser createUser(String username, String password, String fullName, String email)
Creates a user in JIRA with the specified user details

void deleteGroup(String groupName, String swapGroupName)
Deletes the group denoted by the given group name.
void deleteIssue(String issueKey)
Deletes the issue with the given key

RemotePermissionScheme deletePermissionFrom(String permissionSchemeName, Long permissionCode, String entityName)
Removes the permission to the given entity name (username or group name)

void deletePermissionScheme(String permissionSchemeName)
Deletes the permission scheme denoted by the given name

void deleteProject(String projectKey)
Deletes the project represented by the given project key.
void deleteProjectAvatar(Long avatarId)
Deletes the given custom Avatar from the system.
void deleteProjectRole(Long projectRoleId, Boolean confirm)
Deletes the project role denoted by the given project role id.
void deleteUser(String username)
Deletes a user in JIRA with the specified username.
void deleteWorklogAndAutoAdjustRemainingEstimate(String worklogId)
Deletes the worklog with the given id and updates the remaining estimate field on the isssue by increasing it by the time spent amount on the worklog being deleted.
void deleteWorklogAndRetainRemainingEstimate(String worklogId)
Deletes the worklog with the given id but leaves the remaining estimate field on the isssue unchanged.
void deleteWorklogWithNewRemainingEstimate(String workLogId, String newRemainingEstimate)
Deletes the worklog with the given id and sets the remaining estimate field on the isssue to the given value.
void disconnect()
Performs a logout call to Jira.
RemoteComment editComment(Long commentId, String body, String updateAuthor)
Edits the comment denoted by the given id

List<Object> getAllPermissions()
Returns all the permissions.
List<Object> getAssociatedNotificationSchemes(Long projectRoleId)
Returns the associated notification schemes for the given project role.
List<Object> getAssociatedPermissionSchemes(Long projectRoleId)
Returns the associated permission schemas for the given project role.
List<Object> getAttachmentsFromIssue(String issueKey)
Returns the attachments for the issue denoted by the given key.
List<Object> getAvailableActions(String issueKey)
Finds the available actions for the given issue key

RemoteComment getComment(Long commentId)
Finds a comment.
List<Object> getComments(String issueKey)
Returns the comments for the issue denoted by the given key.
List<Object> getComponents(String projectKey)
Returns an array of all the components for the specified project key.
RemoteConfiguration getConfiguration()
Returns information about the current configuration of JIRA.
String getConnectionAddress()
String getConnectionUser()
List<Object> getCustomFields()
Returns the custom fields for the current user

RemoteRoleActors getDefaultRoleActors(Long projectRoleId)
Returns the default role actors for the given project role id.
List<Object> getFavouriteFilters()
This retreives a list of the currently logged in user's favourite fitlers.
List<Object> getFieldsForAction(String issueKey, String actionIdString)
Returns the fields for the given action.
List<Object> getFieldsForEdit(String issueKey)
Returns the fields for edit for the given issue key

RemoteGroup getGroup(String groupName)
Find the group with the specified name in JIRA.
RemoteIssue getIssue(String issueKey)
Finds an issue by key.
RemoteIssue getIssueById(String issueId)
Returns the issue for the given issue id.
long getIssueCountForFilter(String filterId)
Returns the issue count for the filter denoted by this id.
List<Object> getIssueTypes()
Returns an array of all the issue types for all projects in JIRA.
List<Object> getIssueTypesForProject(String projectId)
Returns an array of all the (non-sub task) issue types for the specified project id.
List<Object> getIssuesFromFilterWithLimit(String filterId, Integer offset, Integer maxNumResults)
Returns issues that match the saved filter specified by the filterId.
List<Object> getIssuesFromJqlSearch(String jqlSearch, Integer maxNumResults)
Execute a specified JQL query and return the resulting issues.
List<Object> getIssuesFromTextSearchWithLimit(String searchTerms, Integer offset, Integer maxNumResults)
Returns issues containing searchTerms.
List<Object> getIssuesFromTextSearchWithProject(List<String> projectKeys, String searchTerms, Integer maxNumResults)
Returns issues containing searchTerms that are within the specified projects.
List<Object> getNotificationSchemes()
Returns notification schemes.
List<Object> getPermissionSchemes()
Returns the permission schemes.
List<Object> getPriorities()
Returns an array of all the issue statuses in JIRA.
RemoteAvatar getProjectAvatar(String projectKey)
Retrieves the current avatar for the given project.
List<Object> getProjectAvatars(String projectKey, Boolean includeSystemAvatars)
Retrieves avatars for the given project.
RemoteProject getProjectById(Long projectId)
Returns the Project with the matching id (if the user has permission to browse it).
RemoteProject getProjectByKey(String projectKey)
Returns the Project with the matching key (if the user has permission to browse it).
RemoteProjectRole getProjectRole(Long projectRoleId)
Returns the project role by projectRoleId.
RemoteProjectRoleActors getProjectRoleActors(Long projectRoleId, String projectKey)
Returns the project role actors for the given project

List<Object> getProjectRoles()
Returns the project roles.
RemoteProject getProjectWithSchemesById(Long projectId)
Returns the Project with the matching id (if the user has permission to browse it) with notification, issue security and permission schemes attached.
List<Object> getProjectsNoSchemes()
Returns an array of all the Projects defined in JIRA.
Calendar getResolutionDateById(Long issueId)
Given an issue id, this method returns the resolution date for this issue.
Calendar getResolutionDateByKey(String issueKey)
Given an issue key, this method returns the resolution date for this issue.
List<Object> getResolutions()
Returns an array of all the issue resolutions in JIRA.
RemoteSecurityLevel getSecurityLevel(String issueKey)
Returns the current security level for given issue

List<Object> getSecurityLevels(String projectKey)
Returns an array of all security levels for a given project.
List<Object> getSecuritySchemes()
Returns the security schemes.
RemoteServerInfo getServerInfo()
Returns information about the server JIRA is running on including build number and base URL.
List<Object> getStatuses()
Returns an array of all the issue statuses in JIRA.
List<Object> getSubTaskIssueTypes()
Returns an array of all the sub task issue types in JIRA.
List<Object> getSubTaskIssueTypesForProject(String projectId)
Returns an array of all the sub task issue types for the specified project id.
Boolean getUseCustomFieldsExternalName()
RemoteUser getUser(String username)
Returns information about a user defined to JIRA.
List<Object> getVersions(String projectKey)
Returns an array of all the versions for the specified project key.
List<Object> getWorklogs(String issueKey)
Returns all worklogs for the given issue.
boolean hasPermissionToCreateWorklog(String issueKey)
Determines if the user has the permission to add worklogs to the specified issue, that timetracking is enabled in JIRA and that the specified issue is in an editable workflow state.
boolean hasPermissionToDeleteWorklog(String worklogId)
Determine whether the current user has the permission to delete the supplied worklog, that timetracking is enabled in JIRA and that the associated issue is in an editable workflow state.
boolean hasPermissionToEditComment(Long commentId)
Returns whether the current user has permissions to edit the comment denoted by the given id.
boolean hasPermissionToUpdateWorklog(String worklogId)
Determine whether the current user has the permission to update the supplied worklog, that timetracking is enabled in JIRA and that the associated issue is in an editable workflow state.
boolean isProjectRoleNameUnique(String name)
Checks if the given project role name is unique.
String login(String username, String password)
Log in using the given credentials, it returns the authentication token.
boolean logout(String token)
Cleans up an authentication token that was previously created with a call to login

RemoteIssue progressWorkflowAction(String issueKey, String actionIdString, Map<String, String> fields)
This will progress an issue through a workflow.
void refreshCustomFields()
Refreshs custom fields for the current user.
void releaseVersion(String projectKey, String versionName)
Releases the version denoted by the given name

void removeActorsFromProjectRole(List<String> actors, Long projectRoleId, String projectKey, String actorType)
Removes the given actors from the project role

void removeAllRoleActorsByNameAndType(String name, String type)
Removes all role actors using the given name and type.
void removeAllRoleActorsByProject(String projectKey)
Removes all role actors for the given project key.
void removeDefaultActorsFromProjectRole(List<String> actors, Long remoteProjectRoleId, String type)
Removes the default actors from the project role denoted by this id.
void removeUserFromGroup(String groupName, String userName)
Removes a user from the group name.
void setClient(JiraClient<?> client)
void setConnectionAddress(String connectionAddress)
void setConnectionUser(String connectionUser)
void setNewProjectAvatar(String projectKey, String contentType, String base64ImageData)
Creates a new custom avatar for the given project and sets it to be current for the project.
void setProjectAvatar(String projectKey, Long avatarId)
Sets the current avatar for the given project to that with the given id.
void setUseCustomFieldsExternalName(Boolean useCustomFieldsExternalName)
String toString()
Returns a connection identifier.
RemoteGroup updateGroup(String groupName, List<String> usernames)
Updates the given group name with the provided users.
RemoteIssue updateIssue(String issueKey, Map<String, String> fields)
This will update an issue with new values.
List<RemoteIssue> updateIssuesByJql(String jql, Map<String, String> fields, Integer maxRecordsToUpdate)
This will update the set of issues that result from the jql search NOTE : You cannot update the 'status' field of the issues via this method.
RemoteProject updateProject(String key, String description, String url, String lead, String permissionSchemeName, String notificationSchemeName, String securityShemeName)
Updates the project denoted by the given key.
void updateProjectRole(Long projectRoleId, String projectRoleName, String projectRoleDescription)
Updates the project role with the given id.
void updateWorklogWithNewRemainingEstimate(String issueKey, String worklogId, String newRemainingEstimate, String comment, String groupLevel, String roleLevelId)
Modifies the worklog with the id of the given worklog, updating its fields to match the given worklog and sets the remaining estimate field on the relevant issue to the given value.
boolean validateConnection()
Returns whether the current user is authenticated.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

private static final String MULTIVALUED_FIELD_SEPARATOR

Constant Value: "\|"

Fields

private JiraClient<List<Object>> client

private String connectionAddress

private String connectionUser

private Calendar customFieldsCacheExpiration

private Map<String, String> customFieldsNamesToIdsMapping

private String token

private Boolean useCustomFieldsExternalName

if external custom fields names (instead of internal ids) are used when modifying custom fields, the provided user must be a Jira administrator in order to be able to use this feature

Public Constructors

public JiraConnector ()

Public Methods

public void addActorsToProjectRole (List<String> actors, Long projectRoleId, String projectKey, String actorType)

Adds the given actors to the project role.

Parameters
actors The actors to add
projectRoleId The id of the project role to use
projectKey The key of project to use
actorType The actor type to use

public boolean addBase64EncodedAttachmentsToIssue (String issueKey, List<String> fileNames, List<String> base64EncodedAttachmentData)

An alternative mechanism for adding attachments to an issue. This method accepts the data of the attachments as Base64 encoded strings instead of byte arrays. This is to combat the XML message bloat created by Axis when SOAP-ifying byte arrays. For more information, please see JRA-11693.

Parameters
issueKey The issue to attach to
fileNames An array of filenames; each element names an attachment to be uploaded
base64EncodedAttachmentData An array of Base 64 encoded Strings; each element contains the data of the attachment to be uploaded
Returns
  • true if attachments were successfully added; if the operation was not successful, an exception would be thrown

public void addComment (String issueKey, String commentAuthor, String commentBody, String commentGroupLevel, String commentRoleLevel)

Adds a new comment to the issue.

Parameters
issueKey The key of the issue
commentAuthor The author of the comment
commentBody The body of the comment
commentGroupLevel The group level of the comment
commentRoleLevel The role level of the comment

public void addDefaultActorsToProjectRole (List<String> actors, Long projectRoleId, String type)

Adds the default actors to the project role denoted by this id.

Parameters
actors The actors to add
projectRoleId The id of the project role
type The type

public RemotePermissionScheme addPermissionTo (String permissionSchemeName, Long permissionCode, String entityName)

Adds the permission to the given entity name (username or group name)

Parameters
permissionSchemeName The name of the permission scheme to use
permissionCode The permission code to use
entityName The entity name, username or group name
Returns
  • the modified permission scheme

public void addUserToGroup (String groupName, String userName)

Adds a user to the given group name.

Parameters
groupName The group name
userName The user name

public RemoteVersion addVersion (String projectKey, String versionName, Boolean archived, Boolean released, String releaseDate)

Adds a new version

Parameters
projectKey The project key to use
versionName The version name to use
archived Whether is archived
released Whether is released
releaseDate The release date to use in the format MM-dd-yyy'T'HH:mm:ss
Returns
  • the new version

public RemoteWorklog addWorklogAndAutoAdjustRemainingEstimate (String issueKey, String timeSpent, String startDate, String comment, String groupLevel, String roleLevelId)

Adds a worklog to the given issue.

Parameters
issueKey The key of the issue.
timeSpent Specifies a time duration in JIRA duration format, representing the time spent working on the worklog, eg 1d 2h.
startDate The start date of the worklog using the format MM-dd-yyy'T'HH:mm:ss
comment Add a comment to the worklog.
groupLevel The new group level.
roleLevelId The new role level id.
Returns
  • Created worklog with the id set or null if no worklog was created.

public RemoteWorklog addWorklogAndRetainRemainingEstimate (String issueKey, String timeSpent, String startDate, String comment, String groupLevel, String roleLevelId)

Adds a worklog to the given issue but leaves the issue's remaining estimate field unchanged.

Parameters
issueKey The key of the issue.
timeSpent Specifies a time duration in JIRA duration format, representing the time spent working on the worklog, eg 1d 2h.
startDate The start date of the worklog using the format MM-dd-yyy'T'HH:mm:ss
comment Add a comment to the worklog.
groupLevel The new group level.
roleLevelId The new role level id.
Returns
  • Created worklog with the id set or null if no worklog was created.

public RemoteWorklog addWorklogWithNewRemainingEstimate (String issueKey, String timeSpent, String startDate, String newRemainingEstimate, String comment, String groupLevel, String roleLevelId)

Adds a worklog to the given issue and sets the issue's remaining estimate field to the given value.

Parameters
issueKey The key of the issue.
timeSpent Specifies a time duration in JIRA duration format, representing the time spent working on the worklog, eg 1d 2h.
startDate The start date of the worklog using the format MM-dd-yyy'T'HH:mm:ss
newRemainingEstimate Specifies the issue's remaining estimate as a duration string, eg 1d 2h.
comment Add a comment to the worklog.
groupLevel The new group level.
roleLevelId The new role level id.
Returns
  • Created worklog with the id set or null if no worklog was created.

public void archiveVersion (String projectKey, String versionName, Boolean archive)

Archieves the given version/

Parameters
projectKey The project key to use
versionName The version name to use
archive Whether it should be archived

public void connect (String connectionUser, String connectionPassword, String connectionAddress)

Creates a connection to Jira by making a login call with the given credentials to the specified address. The login call, if successfull, returns a token which will be used in the subsequent calls to Jira.

Parameters
connectionUser The user login user
connectionPassword The user login pass
connectionAddress The JIRA Server Soap address. It usually looks like https://<jira server hostname>/rpc/soap/jirasoapservice-v2 or http://<jira server hostname>/rpc/soap/jirasoapservice-v2
Throws
ConnectionException

public RemoteGroup createGroup (String groupName, String userName)

Creates a group with the given name optionally adding the given user to it.

Parameters
groupName The name of the group to create.
userName The user to add to the group (if null, no user will be added).
Returns
  • the RemoteGroup created

public RemoteIssue createIssue (String assignee, String summary, String description, String dueDate, String environment, String priority, String project, String reporter, String type, Long votes, Map<String, String> customFields, String componentName, String componentId)

Creates an issue.

Parameters
assignee The assignee of the new issue
summary The summary of the new issue
description The description of the new issue
dueDate The due date of the new issue using the format MM-dd-yyy'T'HH:mm:ss
environment The environment of the new issue
priority The priority of the new issue
project The project of the new issue
reporter The reporter of the new issue
type The type of the new issue
votes The votes of the new issue
customFields The custom fields of the new issue, the keys of the map are the field ids, the values should be separated by a "|" if it is multivalued
componentName The component name
componentId The componentId
Returns
  • the new created issue

public RemoteIssue createIssueUsingObject (RemoteIssue issue)

Creates an issue.

Parameters
issue JIRA issue to be created
Returns
  • the new created issue

public RemoteIssue createIssueWithSecurityLevel (String assignee, String summary, String description, String dueDate, String environment, String priority, String project, String reporter, String type, Long votes, Map<String, String> customFields, Long securityLevelId, String componentName, String componentId)

Creates an issue using the the security level denoted by the given id.

Parameters
assignee The assignee of the new issue
summary The summary of the new issue
description The description of the new issue
dueDate The due date of the new issue using the format MM-dd-yyy'T'HH:mm:ss
environment The environment of the new issue
priority The priority of the new issue
project The project of the new issue
reporter The reporter of the new issue
type The type of the new issue
votes The votes of the new issue
customFields The custom fields of the new issue, the keys of the map are the field ids, the values should be separated by a "|" if it is multivalued
securityLevelId The id of the security level to use
componentName The component name
componentId The componentId
Returns
  • the new created issue

public RemotePermissionScheme createPermissionScheme (String name, String description)

Creates a new permission schema using the given name and description.

Parameters
name The name of the new permission scheme
description The description of the new permission scheme
Returns
  • the created permission scheme

public RemoteProject createProject (String key, String name, String description, String url, String lead, String permissionSchemeName, String notificationSchemeName, String securityShemeName)

Creates a new project

Parameters
key The key for the new project
name The name for the new project
description The description for the new project
url The url for the new project
lead The lead of the new project
permissionSchemeName The name of the permission scheme for the new project
notificationSchemeName The name of the notification scheme for the new project
securityShemeName The name of the security scheme for the new project
Returns
  • the new project

public RemoteProjectRole createProjectRole (String projectRoleName, String projectRoleDescription)

Creates a new project role.

Parameters
projectRoleName The name of the new project role
projectRoleDescription The description of the new project role
Returns
  • the created project role

public RemoteUser createUser (String username, String password, String fullName, String email)

Creates a user in JIRA with the specified user details

Parameters
username The user name to create
password The password for the new user
fullName The full name of the new user
email The email of the new user
Returns
  • the newly created RemoteUser

public void deleteGroup (String groupName, String swapGroupName)

Deletes the group denoted by the given group name.

Parameters
groupName The group name to use
swapGroupName The swap group name to use

public void deleteIssue (String issueKey)

Deletes the issue with the given key

Parameters
issueKey The key of the issue to delete

public RemotePermissionScheme deletePermissionFrom (String permissionSchemeName, Long permissionCode, String entityName)

Removes the permission to the given entity name (username or group name)

Parameters
permissionSchemeName The name of the permission scheme to use
permissionCode The permission code to use
entityName The entity name, username or group name
Returns
  • the modified permission scheme

public void deletePermissionScheme (String permissionSchemeName)

Deletes the permission scheme denoted by the given name

Parameters
permissionSchemeName The name of the permission scheme to delete

public void deleteProject (String projectKey)

Deletes the project represented by the given project key.

Parameters
projectKey The key of the project to delete

public void deleteProjectAvatar (Long avatarId)

Deletes the given custom Avatar from the system. System avatars cannot be deleted. Project administration permission is required.

Parameters
avatarId Id of the custom avatar to delete.

public void deleteProjectRole (Long projectRoleId, Boolean confirm)

Deletes the project role denoted by the given project role id.

Parameters
projectRoleId The id of the project role to delete
confirm Whether confirm

public void deleteUser (String username)

Deletes a user in JIRA with the specified username.

Parameters
username The user name to delete

public void deleteWorklogAndAutoAdjustRemainingEstimate (String worklogId)

Deletes the worklog with the given id and updates the remaining estimate field on the isssue by increasing it by the time spent amount on the worklog being deleted. The time spent field of the issue is reduced by the time spent amount on the worklog being deleted.

the SOAP auth token.

Parameters
worklogId The id of the worklog to delete.

public void deleteWorklogAndRetainRemainingEstimate (String worklogId)

Deletes the worklog with the given id but leaves the remaining estimate field on the isssue unchanged. The time spent field of the issue is reduced by the time spent amount on the worklog being deleted.

the SOAP auth token.

Parameters
worklogId The id of the worklog to delete.

public void deleteWorklogWithNewRemainingEstimate (String workLogId, String newRemainingEstimate)

Deletes the worklog with the given id and sets the remaining estimate field on the isssue to the given value. The time spent field of the issue is reduced by the time spent amount on the worklog being deleted.

the SOAP auth token.

Parameters
workLogId The id of the worklog to delete.
newRemainingEstimate The new value for the issue's remaining estimate as a duration string, eg 1d 2h.

public void disconnect ()

Performs a logout call to Jira.

public RemoteComment editComment (Long commentId, String body, String updateAuthor)

Edits the comment denoted by the given id

Parameters
commentId The id of the comment to edit
body The updated body comment
updateAuthor The update author
Returns
  • the edited comment

public List<Object> getAllPermissions ()

Returns all the permissions.

Returns
  • all the permissions

public List<Object> getAssociatedNotificationSchemes (Long projectRoleId)

Returns the associated notification schemes for the given project role.

Parameters
projectRoleId The project role to search
Returns
  • the associated notification schemes for the given project role.

public List<Object> getAssociatedPermissionSchemes (Long projectRoleId)

Returns the associated permission schemas for the given project role.

Parameters
projectRoleId The project role to search
Returns
  • the associated permission schemas for the given project role.

public List<Object> getAttachmentsFromIssue (String issueKey)

Returns the attachments for the issue denoted by the given key.

Parameters
issueKey The issue key to use
Returns
  • the attachments for the issue denoted by the given key.

public List<Object> getAvailableActions (String issueKey)

Finds the available actions for the given issue key

Parameters
issueKey The key of the issue
Returns
  • the available actions for the given issue key

public RemoteComment getComment (Long commentId)

Finds a comment.

Parameters
commentId The commentId of the comment
Returns
  • the RemoteComment

public List<Object> getComments (String issueKey)

Returns the comments for the issue denoted by the given key.

Parameters
issueKey The key of the issue to get the comments for
Returns
  • the comments for the issue denoted by the given key.

public List<Object> getComponents (String projectKey)

Returns an array of all the components for the specified project key.

Parameters
projectKey The key of the requested project
Returns
  • an array of RemoteComponent objects

public RemoteConfiguration getConfiguration ()

Returns information about the current configuration of JIRA.

Returns
  • a RemoteConfiguration object which contains information about the current configuration of JIRA.

public String getConnectionAddress ()

public String getConnectionUser ()

public List<Object> getCustomFields ()

Returns the custom fields for the current user

Returns
  • the custom fields for the current user

public RemoteRoleActors getDefaultRoleActors (Long projectRoleId)

Returns the default role actors for the given project role id.

Parameters
projectRoleId The id of the project role
Returns
  • the default role actors for the given project role id.

public List<Object> getFavouriteFilters ()

This retreives a list of the currently logged in user's favourite fitlers.

Returns
  • a list of the currently logged in user's favourite fitlers.

public List<Object> getFieldsForAction (String issueKey, String actionIdString)

Returns the fields for the given action.

Parameters
issueKey The issue key to use
actionIdString The action id to use
Returns
  • the fields for the given action

public List<Object> getFieldsForEdit (String issueKey)

Returns the fields for edit for the given issue key

Parameters
issueKey The issue key to get the fields for
Returns
  • the fields for edit

public RemoteGroup getGroup (String groupName)

Find the group with the specified name in JIRA.

Parameters
groupName The name of the group to find
Returns
  • a RemoteGroup object for the found group or null if it cant be found.

public RemoteIssue getIssue (String issueKey)

Finds an issue by key.

Parameters
issueKey The key of the issue to find.
Returns
  • the issue matching the given key.

public RemoteIssue getIssueById (String issueId)

Returns the issue for the given issue id.

Parameters
issueId The issue id to use
Returns
  • the issue for the given issue id.

public long getIssueCountForFilter (String filterId)

Returns the issue count for the filter denoted by this id.

Parameters
filterId The fiter id to use
Returns
  • the issue count for the filter denoted by this id.

public List<Object> getIssueTypes ()

Returns an array of all the issue types for all projects in JIRA.

Returns
  • an array of RemoteIssueType objects

public List<Object> getIssueTypesForProject (String projectId)

Returns an array of all the (non-sub task) issue types for the specified project id.

Parameters
projectId Id of the project
Returns
  • an array of RemoteIssueType objects

public List<Object> getIssuesFromFilterWithLimit (String filterId, Integer offset, Integer maxNumResults)

Returns issues that match the saved filter specified by the filterId. This method will return no more than the maxNumResults.

It will start the result set at the provided off set.

This method also respects the jira.search.views.max.limit and jira.search.views.max.unlimited.group JIRA properties which will override the max number of results returned.

If the jira.search.views.max.limit property is set and you are not in a group specified by jira.search.views.max.unlimited.group then the number of results returned will be constrained by the value of jira.search.views.max.limit if it is less than the specified maxNumResults.

Parameters
filterId Identifies the saved filter to use for the search.
offset The place in the result set to use as the first result returned
maxNumResults The maximum number of results that this method will return.
Returns
  • issues matching the saved filter

public List<Object> getIssuesFromJqlSearch (String jqlSearch, Integer maxNumResults)

Execute a specified JQL query and return the resulting issues. This method also respects the jira.search.views.max.limit and jira.search.views.max.unlimited.group JIRA properties which will override the max number of results returned.

If the jira.search.views.max.limit property is set and you are not in a group specified by jira.search.views.max.unlimited.group then the number of results returned will be constrained by the value of jira.search.views.max.limit if it is less than the specified maxNumResults.

Parameters
jqlSearch JQL query string to execute
maxNumResults The maximum number of results that this method will return
Returns
  • issues matching the JQL query

public List<Object> getIssuesFromTextSearchWithLimit (String searchTerms, Integer offset, Integer maxNumResults)

Returns issues containing searchTerms. Note: this is a fuzzy search, returned in order of 'relevance', so the results are only generally useful for human consumption.

This method will return no more than the maxNumResults.

It will start the result set at the provided off set.

This method also respects the jira.search.views.max.limit and jira.search.views.max.unlimited.group JIRA properties which will override the max number of results returned.

If the jira.search.views.max.limit property is set and you are not in a group specified by jira.search.views.max.unlimited.group then the number of results returned will be constrained by the value of jira.search.views.max.limit if it is less than the specified maxNumResults.

Parameters
searchTerms Search terms
offset The place in the result set to use as the first result returned
maxNumResults The maximum number of results that this method will return.
Returns
  • issues matching the search terms

public List<Object> getIssuesFromTextSearchWithProject (List<String> projectKeys, String searchTerms, Integer maxNumResults)

Returns issues containing searchTerms that are within the specified projects. Note: this is a fuzzy search, returned in order of 'relevance', so the results are only generally useful for human consumption.

This method will return no more than the maxNumResults.

This method also respects the jira.search.views.max.limit and jira.search.views.max.unlimited.group JIRA properties which will override the max number of results returned.

If the jira.search.views.max.limit property is set and you are not in a group specified by jira.search.views.max.unlimited.group then the number of results returned will be constrained by the value of jira.search.views.max.limit if it is less than the specified maxNumResults.

Parameters
projectKeys The project keys to use
searchTerms Earch terms
maxNumResults The maximum number of results that this method will return.
Returns
  • issues matching the search terms

public List<Object> getNotificationSchemes ()

Returns notification schemes.

Returns
  • the notification schemes.

public List<Object> getPermissionSchemes ()

Returns the permission schemes.

Returns
  • the permission schemes.

public List<Object> getPriorities ()

Returns an array of all the issue statuses in JIRA.

Returns
  • an array of RemoteStatus objects

public RemoteAvatar getProjectAvatar (String projectKey)

Retrieves the current avatar for the given project. Project browse permission is required.

Parameters
projectKey The key for the project.
Returns
  • the current avatar for the project.

public List<Object> getProjectAvatars (String projectKey, Boolean includeSystemAvatars)

Retrieves avatars for the given project. If the includeSystemAvatars parameter is true, this will include both system (built-in) avatars as well as custom (user-supplied) avatars for that project, otherwise it will include only the custom avatars. Project browse permission is required.

Parameters
projectKey The key for the project.
includeSystemAvatars If false, only custom avatars will be included in the returned array.
Returns
  • the avatars for the project, possibly empty.

public RemoteProject getProjectById (Long projectId)

Returns the Project with the matching id (if the user has permission to browse it).

Parameters
projectId The id of the requested project
Returns
  • the RemoteProject object specified by the key, if it exists and the user has the BROWSE permission for it

public RemoteProject getProjectByKey (String projectKey)

Returns the Project with the matching key (if the user has permission to browse it).

Parameters
projectKey The key of the requested projec
Returns
  • the RemoteProject object specified by the key, if it exists and the user has the BROWSE permission for it

public RemoteProjectRole getProjectRole (Long projectRoleId)

Returns the project role by projectRoleId.

Parameters
projectRoleId The projectRoleId of the project role
Returns
  • the project role by projectRoleId.

public RemoteProjectRoleActors getProjectRoleActors (Long projectRoleId, String projectKey)

Returns the project role actors for the given project

Parameters
projectRoleId The project role id to use
projectKey The project key to use
Returns
  • the project role actors for the given project

public List<Object> getProjectRoles ()

Returns the project roles.

Returns
  • the project roles.

public RemoteProject getProjectWithSchemesById (Long projectId)

Returns the Project with the matching id (if the user has permission to browse it) with notification, issue security and permission schemes attached.

Parameters
projectId The id of the requested project
Returns
  • the RemoteProject object specified by the key, if it exists and the user has the BROWSE permission for it

public List<Object> getProjectsNoSchemes ()

Returns an array of all the Projects defined in JIRA.

Returns
  • an array of RemoteProject objects.

public Calendar getResolutionDateById (Long issueId)

Given an issue id, this method returns the resolution date for this issue. If the issue hasn't been resolved yet, this method will return null. If the no issue with the given id exists a RemoteException will be thrown.

Parameters
issueId The id of the issue
Returns
  • The resolution date of the issue. May be null

public Calendar getResolutionDateByKey (String issueKey)

Given an issue key, this method returns the resolution date for this issue. If the issue hasn't been resolved yet, this method will return null.

Parameters
issueKey The key of the issue
Returns
  • The resolution date of the issue. May be null

public List<Object> getResolutions ()

Returns an array of all the issue resolutions in JIRA.

Returns
  • an array of RemoteResolution objects

public RemoteSecurityLevel getSecurityLevel (String issueKey)

Returns the current security level for given issue

Parameters
issueKey The issue key
Returns
  • issue security level

public List<Object> getSecurityLevels (String projectKey)

Returns an array of all security levels for a given project.

Parameters
projectKey The key for the project
Returns
  • array of RemoteSecurityLevels for the project

public List<Object> getSecuritySchemes ()

Returns the security schemes.

Returns
  • the security schemes.

public RemoteServerInfo getServerInfo ()

Returns information about the server JIRA is running on including build number and base URL.

Returns
  • information about the server JIRA is running on including build number and base URL.

public List<Object> getStatuses ()

Returns an array of all the issue statuses in JIRA.

Returns
  • an array of RemoteStatus objects

public List<Object> getSubTaskIssueTypes ()

Returns an array of all the sub task issue types in JIRA.

Returns
  • an array of RemoteIssueType objects

public List<Object> getSubTaskIssueTypesForProject (String projectId)

Returns an array of all the sub task issue types for the specified project id.

Parameters
projectId Id of the project
Returns
  • an array of RemoteIssueType objects

public Boolean getUseCustomFieldsExternalName ()

public RemoteUser getUser (String username)

Returns information about a user defined to JIRA.

Parameters
username The user name to look up
Returns
  • a RemoteUser or null if it cant be found

public List<Object> getVersions (String projectKey)

Returns an array of all the versions for the specified project key.

Parameters
projectKey The key of the requested project
Returns
  • an array of RemoteVersion objects

public List<Object> getWorklogs (String issueKey)

Returns all worklogs for the given issue.

the SOAP auth token.

Parameters
issueKey The key of the issue.
Returns
  • all the worklogs of the issue.

public boolean hasPermissionToCreateWorklog (String issueKey)

Determines if the user has the permission to add worklogs to the specified issue, that timetracking is enabled in JIRA and that the specified issue is in an editable workflow state.

the SOAP auth token.

Parameters
issueKey The key of the issue.
Returns
  • true if the user has permission to create a worklog on the specified issue, false otherwise

public boolean hasPermissionToDeleteWorklog (String worklogId)

Determine whether the current user has the permission to delete the supplied worklog, that timetracking is enabled in JIRA and that the associated issue is in an editable workflow state. This method will return true if the user is a member of the worklog's group/role level (if specified) AND The user has the WORKLOG_DELETE_ALL permission; OR The user is the worklog author and has the WORKLOG_DELETE_OWN permission and false otherwise.

the SOAP auth token.

Parameters
worklogId The id of the worklog wishes to delete.
Returns
  • true if the user has permission to delete the supplied worklog, false otherwise

public boolean hasPermissionToEditComment (Long commentId)

Returns whether the current user has permissions to edit the comment denoted by the given id.

Parameters
commentId The comment id to use
Returns
  • whether the current user has permissions to edit the comment denoted by the given id.

public boolean hasPermissionToUpdateWorklog (String worklogId)

Determine whether the current user has the permission to update the supplied worklog, that timetracking is enabled in JIRA and that the associated issue is in an editable workflow state. This method will return true if the user is a member of the worklog's group/role level (if specified) AND The user has the WORKLOG_EDIT_ALL permission; OR The user is the worklog author and has the WORKLOG_EDIT_OWN permission and false otherwise.

Parameters
worklogId The ide of the worklog wishes to update.
Returns
  • true if the user has permission to update the supplied worklog, false otherwise

public boolean isProjectRoleNameUnique (String name)

Checks if the given project role name is unique.

Parameters
name The project role name to check for uniqueness
Returns
  • true if the given project role name is unique, false otherwise.

public String login (String username, String password)

Log in using the given credentials, it returns the authentication token.

Parameters
username The username to use
password The password to use
Returns
  • the authentication token

public boolean logout (String token)

Cleans up an authentication token that was previously created with a call to login

Parameters
token The token to invalidate
Returns
  • true if the logout succeeded

public RemoteIssue progressWorkflowAction (String issueKey, String actionIdString, Map<String, String> fields)

This will progress an issue through a workflow.

Parameters
issueKey The issue to update.
actionIdString The workflow action to progress to
fields The fields to be updated, the key of the map is the field id and the value is a list of values for that field, the values should be separated by a "|" if it is multivalued
Returns
  • the updated RemoteIssue

public void refreshCustomFields ()

Refreshs custom fields for the current user.

public void releaseVersion (String projectKey, String versionName)

Releases the version denoted by the given name

Parameters
projectKey The project key to use
versionName The version name to release

public void removeActorsFromProjectRole (List<String> actors, Long projectRoleId, String projectKey, String actorType)

Removes the given actors from the project role

Parameters
actors The actors to remove
projectRoleId The id of the project role to use
projectKey The key of project to use
actorType The actor type to use

public void removeAllRoleActorsByNameAndType (String name, String type)

Removes all role actors using the given name and type.

Parameters
name The name to delete
type The type to delete

public void removeAllRoleActorsByProject (String projectKey)

Removes all role actors for the given project key.

Parameters
projectKey The project key for which to remove all role actors

public void removeDefaultActorsFromProjectRole (List<String> actors, Long remoteProjectRoleId, String type)

Removes the default actors from the project role denoted by this id.

Parameters
actors The actors to remove
remoteProjectRoleId The id of the project role
type The type

public void removeUserFromGroup (String groupName, String userName)

Removes a user from the group name.

Parameters
groupName The group name for which to remove the user
userName The username to remove

public void setClient (JiraClient<?> client)

Parameters
client

public void setConnectionAddress (String connectionAddress)

Parameters
connectionAddress

public void setConnectionUser (String connectionUser)

Parameters
connectionUser

public void setNewProjectAvatar (String projectKey, String contentType, String base64ImageData)

Creates a new custom avatar for the given project and sets it to be current for the project. The image data must be provided as base64 encoded data and should be 48 pixels square. If the image is larger, the top left 48 pixels are taken, if it is smaller it is upscaled to 48 pixels. The small version of the avatar image (16 pixels) is generated automatically. Project administration permission is required.

Parameters
projectKey The key for the project.
contentType The MIME type of the image provided, e.g. image/gif, image/jpeg, image/png.
base64ImageData A base 64 encoded image, 48 pixels square.

public void setProjectAvatar (String projectKey, Long avatarId)

Sets the current avatar for the given project to that with the given id. Project administration permission is required.

Parameters
projectKey The key for the project.
avatarId The id of an existing avatar to use for the project or null for the default avatar.

public void setUseCustomFieldsExternalName (Boolean useCustomFieldsExternalName)

Parameters
useCustomFieldsExternalName

public String toString ()

Returns a connection identifier.

public RemoteGroup updateGroup (String groupName, List<String> usernames)

Updates the given group name with the provided users.

Parameters
groupName The group name to update
usernames The updated usernames
Returns
  • the updated group

public RemoteIssue updateIssue (String issueKey, Map<String, String> fields)

This will update an issue with new values. NOTE : You cannot update the 'status' field of the issue via this method.

Parameters
issueKey The issue to update.
fields The fields to be updated, the key of the map is the field id and the value is a list of values for that field, the values should be separated by a "|" if it is multivalued
Returns
  • the updated RemoteIssue

public List<RemoteIssue> updateIssuesByJql (String jql, Map<String, String> fields, Integer maxRecordsToUpdate)

This will update the set of issues that result from the jql search NOTE : You cannot update the 'status' field of the issues via this method.

Parameters
jql The jql to search the issues that will be updated if issueKey is not set.
fields The fields to be updated, the key of the map is the field id and the value is a list of values for that field, the values should be separated by a "|" if it is multivalued
maxRecordsToUpdate The number of issues you expect the jql search will find. If set, the update will only take place if the number of issues found is the same as this
Returns

public RemoteProject updateProject (String key, String description, String url, String lead, String permissionSchemeName, String notificationSchemeName, String securityShemeName)

Updates the project denoted by the given key.

Parameters
key The key of the project to update
description The new description
url The new url
lead The new lead
permissionSchemeName The new permission scheme name
notificationSchemeName The new notification scheme name
securityShemeName The new security scheme name
Returns
  • the updated project

public void updateProjectRole (Long projectRoleId, String projectRoleName, String projectRoleDescription)

Updates the project role with the given id.

Parameters
projectRoleId The id of the project role to update
projectRoleName The new project role name
projectRoleDescription The new project role description

public void updateWorklogWithNewRemainingEstimate (String issueKey, String worklogId, String newRemainingEstimate, String comment, String groupLevel, String roleLevelId)

Modifies the worklog with the id of the given worklog, updating its fields to match the given worklog and sets the remaining estimate field on the relevant issue to the given value. The time spent field of the issue is changed by subtracting the previous value of the worklog's time spent amount and adding the new value in the given worklog.

Parameters
issueKey The issue key to use
worklogId The worklog id to use
newRemainingEstimate The new value for the issue's remaining estimate as a duration string, eg 1d 2h.
comment The new comment
groupLevel The new group level
roleLevelId The new role level id

public boolean validateConnection ()

Returns whether the current user is authenticated. It does not mean tell anything whether the current session has expired