Jira Integration Routines

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here !

Introduction

This section contains routines that enable users to interact with Jira environment.

Attachment Routines

  • attachFileAdd an attachment to a selected issue.
  • attachFileFromURLAdds an attachment located on an URL path to a selected issue.
  • copyAttachmentCopies an attachment from one issue to another.
  • copyAttachmentByIdCopies the attachment for the provided id from one issue to another.
  • deleteAttachmentDeletes the attachment for a given id or for a specified issue and file name.
  • getAttachmentPathGet the file path for the attachments with name <attachment name> attached to <issue key>.

Comment Routines

  • addCommentPosts a comment on the specified issue on behalf of the specified user. Returns a number representing the id of the comment.
  • deleteCommentDeletes a comment with the specified id, deletes the latest comment or deletes all comments from a given issue.
  • editCommentEdits a comment with the specified id and text. Optional, you can edit the security level for comment. Returns the comment representation after the edit.
  • getAllCommentIdsGets all the comment ids that are already entered on an issue.
  • getAllUsersReturns a list of all active and inactive users in Jira.
  • getCommentReturns the comment entered in a transition screen, or an empty string if no comment has been entered or the transition doesn't have a screen.
  • getLastCommentGets all the comment properties for the last issue comment.

Custom Field Routines

  • fieldHistoryReturns all the pairs date + value for the selected field from the selected issue's history.
  • getAllCustomFieldsReturns an array of JCustomField type structs for all custom fields in Jira.
  • getCommentByIdGets all the comment properties for a given id.
  • getCustomFieldNameByIdGets the name of the custom field by id.
  • getFieldChangesReturns a list of tuples containing user|changeDate|field|oldVal|newVal for the selected field from the selected issue's history. Updated in v 4.8.0.8 to include two new fields - oldValString & newValString.
  • getFieldOptionsReturns a string array representing the list of options for a custom field.
  • getInputGets the value of a field in the transition screen. Should only be used in transitions that require a screen.
  • getIssueFieldNamesReturns a list with the names of all standard and custom fields of an issue.
  • getIssueFieldsReturns a map with all standard and custom fields of an issue. The map contains pairs of field name and field values.
  • getPriorityIdByNameGets the priority id by the priority name.
  • getPriorityNameByIdGets the priority name by the priority id.
  • hasInputVerifies if a field had input in the transition screen. Should only be used in transitions that require a screen.
  • isCustomFieldInContextChecks if a custom field is in the context of a specified issue type for a project.
  • lastFieldHistoryReturns the last change details (user | date | field | oldValue | newValue | oldValueString | newValueString) from the selected issue's history.

Group Routines

  • allGroupsReturns the list of group names that exist in the Jira environment. 
  • groupExistsVerifies if the selected group is a registered Jira group.
  • groupsInRole

Issue Routines

  • changeSubtaskOrderChanges subtask position.
  • cloneIssueDuplicates the issue and returns the key of the duplicated issue. If specified, it also creates a link to the duplicated issue.
  • countIssuesReturns the number of issues that matched the search query.
  • createIssueCreates an issue based on the provided arguments.
  • deleteIssueDeletes the selected issue.
  • getIssueEntityPropertyValue
  • getIssueURLReturns the url of the issue.
  • isIssueContextVerifies if the script is running in an issue context.
  • issueExistsChecks to see if the provided issue key relates to an existing issue.
  • lastIssueChangesReturns the last changes details for all the fields touched by user (array of JFieldChange https://appfire.atlassian.net/wiki/display/SIL/Predefined+structure+types#Predefinedstructuretypes-JFieldChange) from the selected issue's history.
  • moveIssue
  • selectIssuesReturns an array with the keys of the issues that matched the search query.
  • selectIssuesByFilterReturns an array with the keys of the issues obtained by running the given filter.
  • setIssueEntityPropertyValue
  • subtasksGet the list of sub tasks linked to the parent issue.

Jira System Routines

  • getJIRABaseUrlThis routine returns Jira base url where the SIL script is called.
  • i18nTextReturns the i18n text if the key can be resolved. Otherwise, the key itself will be returned.

Link Routines

  • allLinkedIssuesReturns an array with the issue names linked with the specified issue, including the system links (subtask, issue in epic).
  • createWebLinkCreates a web link on the issue.
  • deleteWebLinkByIdRemoves a web link.
  • getIssueLinksDetailReturns all the details about the links of an issue key.
  • getWebLinkByIdRetrieves information about a web link.
  • getWebLinksForIssueGets the ids of all the web links on an issue.
  • linkedIssuesReturns an array with the Issue keys linked with the specified one.
  • linkIssueLinks two issues by a specified link type name. First issue will have the outward description of the link type, the second issue will have the inward description of the link type.
  • unlinkIssueRemoves the specified link between two issues.

Project Routines

  • allProjectsReturns a string array with the keys of all the projects in Jira.
  • getProjectComponentLeadReturns the leader of the specified component from the specified project.
  • getProjectKeyByNameRetrieves the key for the project with the given name.
  • getProjectRoleIdByNameRetrieves the id for the project role with the given name.
  • getProjectRolesReturns a list of all project role names in Jira.
  • getStatusCategoryGets the category of the status for the given issue.
  • getTeamLeadersReturns the team leaders user keys on the specified project. All the component leads.
  • issueTypesForProjectRetrieves the issue types for the project with the given key.
  • projectMembersReturns a list with all the user keys of the users who have a role in the specified project.
  • projectPMReturns the user key of the project manager (project lead) of the selected project, if exists.
  • projectsForPMReturns all the projects the selected user has the role of project manager (project lead) in.
  • projectsForUserReturns all the projects where this user has permission to assign or to be assigned issues.
  • projectsWithPermissionForUserRetrieves the project keys where the given user has the given permission.

User Routines

  • accountIdToDisplayNameReturns the display name for the provided user key.
  • accountIdToUsernameReturns the username for the provided account id.
  • currentUserReturns the key for the user that invoked the script containing currentUser.
  • currentUserKeyReturns the key for the user that invoked the script containing currentUserKey.
  • currentUsernameReturns the username for the user that invoked the script containing currentUsername.
  • getAllActiveUsersReturns a list of all active users in Jira.
  • getAllInactiveUsersReturns a list of all inactive users in Jira.
  • getUserGets the user by username or key.
  • getUserByEmailGets the user by email address.
  • getUserByFullNameGets the user by full name.
  • getUserDirectoryNameReturns the directory name the user belongs to.
  • getUserKeysFromEmailsFinds the corresponding user keys for a list of email addresses.
  • getUserPropertyRetrieves properties of users created and maintained in Jira (user properties https://confluence.atlassian.com/x/8YxjL).
  • hasPermissionChecks if a user has the specified permission.
  • hasUserPropertyChecks if the user has the given property set.
  • isAnyUserAuthenticatedVerifies if there is a logged in user.
  • isTeamLeaderVerifies if the specified user is a team leader on the project (if it is a component lead).
  • isUserActiveChecks to see if the given user has an active (licensed) account.
  • isUserAdminDetermines if a provided user has administration privileges in the current Jira environment.
  • isUserInRoleReturns "true" if the user has a certain role on the specified project.
  • runAsAssumes a user when running a script.
  • setUserPropertySets properties of users created and maintained in Jira (user properties https://confluence.atlassian.com/x/8YxjL).
  • userEmailAddressReturns the email address of the selected user. The email address may be needed to supply it to various external systems.
  • userExistsVerifies if the selected user is registered Jira user.
  • userFullNameReturns the full name (firstname, lastname) of the user.
  • userGroupsReturns the groups the selected user belongs to.
  • userHasAccessToCommentVerifies if a comment is visible for an user.
  • userInGroupVerifies if the selected user is in the selected group(s).
  • userKeyToDisplayNameReturns the display name for the provided user key.
  • userKeyToUsernameReturns the username for the provided user key.
  • userLanguageReturns the language for an user.
  • userLocaleReturns the locale for a user.
  • usernameToAccountIdReturns the account id for the provided username.
  • usernameToUserKeyReturns the user key / account id for the provided username.
  • userRolesReturns the roles of the provided user in the project.
  • usersInGroupsReturns a list of users common to all the specified groups.
  • usersInRoleReturns the users that corespond to a certain role on the specified project.
  • userHasCoreAccessVerifies if a user has access to the Jira Core application.
  • userHasServiceDeskAccessVerifies if a user has access to the Jira Service Desk application.
  • userHasSoftwareAccessVerifies if a user has access to the Jira Software application.

Workflow Routines

Worklog Routines