Introduction
This section contains routines that enable users to interact with Jira environment.
Attachment Routines
- attachFile — Add an attachment to a selected issue.
- attachFileFromURL — Adds an attachment located on an URL path to a selected issue.
- copyAttachment — Copies an attachment from one issue to another.
- copyAttachmentById — Copies the attachment for the provided id from one issue to another.
- deleteAttachment — Deletes the attachment for a given id or for a specified issue and file name.
- getAttachmentPath — Get the file path for the attachments with name <attachment name> attached to <issue key>.
- saveAttachment
Comment Routines
- getCommentById — Gets all the comment properties for a given id.
- getLastComment — Gets all the comment properties for the last issue comment.
- addComment — SPosts a comment on the specified issue on behalf of the specified user. Returns a number representing the id of the comment.
- deleteComment — Deletes a comment with the specified id, deletes the latest comment or deletes all comments from a given issue.
- editComment — Edits a comment with the specified id and text.
- getAllCommentIds — Gets all the comment ids that are already entered on an issue.
- getComment — Returns 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.
Custom Field Routines
- hasInput — Verifies if a field had input in the transition screen.
- getAllCustomFields — Returns an array of JCustomField type structs for all custom fields in Jira.
- fieldHistory — Returns all the pairs date + value for the selected field from the selected issue's history.
- getCustomField — Gets all information about the custom field. Routine returns a JCustomField structure type.
- getCustomFieldIdByName — Returns a list of ids for all custom fields with the given name.
- getCustomFieldNameById — Gets the name of the custom field by id.
- getFieldChanges — Returns a list of tuples containing user||field|oldVal|newVal for the selected field from the selected issue's history.
- getFieldOptions — Returns a string array representing the list of options for a custom field.
- getInput — Make sure that a transition screen has been attached to the current transition.
- getIssueFieldNames — Returns a list with the names of all standard and custom fields of an issue.
- getIssueFields — Returns a map with all standard and custom fields of an issue.
- getPriorityIdByName — Gets the priority id by the priority name.
- getPriorityNameById — Gets the priority name by the priority id.
- isCustomFieldInContext — Checks if a custom field is in the context of a specified issue type for a project.
- lastFieldHistory — Returns the last change details (user, date, field, oldValue, newValue) from the selected issue's history.
- getContextsForCustomField
- getIssueTypesInCustomFieldContext
- getProjectsInCustomFieldContext
- getIssueTypesInTheSameContext
Group Routines
- groupsInRole — Returns the groups that correspond to a certain role on the specified project.
- allGroups — Returns the list of group names that exist in the Jira environment.
- groupExists — Verifies if the selected group is a registered Jira group.
Issue Routines
- allLinkedIssues — Returns an array with the issue names linked with the specified issue, including the system links (subtask, issue in epic).
- changeSubtaskOrder — Changes subtask position.
- cloneIssue — Duplicates the issue and returns the key of the duplicated issue. If specified, it also creates a link to the duplicated issue.
- countIssues — Returns the number of issues that matched the search query.
- createIssue — Creates an issue based on the provided arguments.
- deleteIssue — Deletes the selected issue.
- getIssueEntityPropertyJson — Returns the entity property in JSON string.
- getIssueEntityPropertyValue — Returns the entity property value as a String.
- getIssueURL — Returns the url of the issue.
- getStatusCategory — Gets the category of the status for the given issue.
- isIssueContext — Verifies if the script is running in an issue context.
- issueExists — Checks to see if the provided issue key relates to an existing issue.
- lastIssueChanges — Returns the last changes details for all the fields touched by user from the selected issue's history.
- moveIssue — This routine helps moving the issue (including sub-tasks, custom/standard fields, attachments) between projects.
- selectIssues — Returns an array with the keys of the issues that matched the search query.
- selectIssuesByFilter — Returns an array with the keys of the issues obtained by running the given filter.
- subtasks — Get the list of sub tasks linked to the parent issue.
- addHistoryItem
- isInReindexing
Jira System Routines
- i18nText — Returns the i18n text if the key can be resolved. Otherwise, the key itself will be returned.
- getJIRABaseUrl — This routine returns Jira base url where the SIL script is called.
Link Routines
- cpCfValueToLinkedIssue — Enables to copy a custom field value to linked issues or by linking type. We also support custom Fields from the Portfolio plugin.
- createWebLink — Creates a web link on the issue.
- deleteWebLinkById — Removes a web link.
- getIssueLinksDetail — Returns all the details about the links of an issue key.
- getWebLinkById — Retrieves information about a web link.
- getWebLinksForIssue — Gets the ids of all the web links on an issue.
- linkedIssues — Returns an array with the Issue keys linked with the specified one.
- linkIssue — Links 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.
- unlinkIssue — Removes the specified link between two issues.
Project Routines
- getComponentsObjects — Returns all the project components as an array of JComponent structures.
- getVersionsObjects — Returns all the project versions as an array of JVersion structures.
- allProjects — Returns a string array with the keys of all the projects in Jira.
- getProjectComponentLead — Returns the leader of the specified component from the specified project.
- getProjectKeyByName — Retrieves the key for the project with the given name.
- getProjectRoleIdByName — Retrieves the id for the project role with the given name.
- getProjectRoles — Returns a list of all project role names in Jira.
- getTeamLeaders — Returns the team leaders user keys on the specified project. All the component leads.
- issueTypesForProject — Retrieves the issue types for the project with the given key.
- projectMembers — Returns a list with all the user keys of the users who have a role in the specified project.
- projectPM — Returns the user key of the project manager (project lead) of the selected project, if exists.
- projectsForPM — Returns all the projects the selected user has the role of project manager (project lead) in.
- projectsForUser — Returns all the projects where this user has permission to assign or to be assigned issues.
- projectsWithPermissionForUser — Retrieves the project keys where the given user has the given permission.
- projectObject — Returns the project properties.
User Routines
- userKeyToDisplayName — Returns the display name for the provided user key.
- getUser — Gets the user by username or key.
- accountIdToDisplayName — Returns the display name for the provided user key.
- currentUser — Returns the key for the user that invoked the script containing currentUser.
- currentUserKey — Returns the key for the user that invoked the script containing currentUserKey.
- currentUsername — Returns the username for the user that invoked the script containing currentUsername.
- getAllActiveUsers — Returns a list of all active users in Jira.
- getAllInactiveUsers — Returns a list of all inactive users in Jira.
- getAllUsers — Returns a list of usernames for all active and inactive users in Jira.
- userGroups — Returns the groups the selected user belongs to.
- getUserByEmail — Gets the user by email address.
- getUserByFullName — Gets the user by full name.
- getUserDirectoryName — Returns the directory name the user belongs to.
- getUserProperty — Retrieves properties of users.
- hasPermission — Checks if a user has the specified permission.
- hasUserProperty — Checks if the user has the given property set.
- isAnyUserAuthenticated — Verifies if there is a logged in user.
- isTeamLeader — Verifies if the specified user is a team leader on the project (if it is a component lead).
- isUserActive — Checks to see if the given user has an active (licensed) account.
- isUserAdmin — Determines if a provided user has administration privileges in the current Jira environment.
- isUserInRole — Returns "true" if the user has a certain role on the specified project.
- runAs — Assumes a user when running a script.
- setUserProperty — Sets properties of users.
- userEmailAddress — Returns the email address of the selected user. The email address may be needed to supply it to various external systems.
- userExists — Verifies if the selected user is registered Jira user.
- userFullName — Returns the full name (firstname, lastname) of the user.
- userHasAccessToComment — Verifies if a comment is visible for an user.
- userHasCoreAccess — Verifies if a user has access to the Jira Core application.
- userHasServiceDeskAccess — Verifies if a user has access to the Jira Service Desk application.
- userHasSoftwareAccess — Verifies if a user has access to the Jira Software application.
- userInGroup — Verifies if the selected user is in the selected group(s).
- userKeyToUsername — Returns the username for the provided user key.
- userLanguage — Returns the language for an user.
- userLocale — Returns the locale for a user.
- usernameToUserKey — Returns the user key / account id for the provided username.
- userRoles — Returns the roles of the provided user in the project.
- usersInGroups — Returns a list of users common to all the specified groups.
- usersInRole — Returns the users that corespond to a certain role on the specified project.
Workflow Routines
- getAllWorkflows — Retrieves a list of all workflows in the Jira environment.
- getAllWorkflowTransitions — Retrieves a list of workflow transition actions.
- getWorkflowsFromSchemeName — Retrieves a list of workflows associated to a workflow scheme.
- autotransition — Executes a transition and moves to the specified step.
- getAllWorkflowSchemeNames — Retrieves a list of Workflow Scheme names in a Jira environment.
- getAvailableTransitions — Retrieves all available transitions for the current user from the given issue state.
- getStatusIdByName — Gets the status id by the status name.
- getStatusNameById — Gets the status name by the status id.
- getTransitionNameById — Gets the transition name by the workflow name and transition id.
- getWorkflowName — Gets the name of the workflow corresponding to the given issue.
- getWorkflowStatusIds — Retrieves an unique list of statuses (ids) for a given workflow.
- getWorkflowTransition — Retrieves transition information for a single workflow transition.
- raiseEvent — Triggers an event to be processed by listeners.
Worklog Routines
- removeWorklogExistingEstimate — Removes the worklog and keeps Remaining time the same.
- removeWorklogAdjustEstimate — Removes the worklog and the Remaining will be increased by the time from the worklog.
- addWorklogAdjustEstimate — Adds worklog. The remaining time is reduced by the amount of work done, but never below 0.
- addWorklogExistingEstimate — Adds worklog and keeps remaining time the same.
- addWorklogReduceEstimateBy — Adds worklog and the remaining time will be reduced by the value of reduceBY, but never below 0.
- addWorklogSetEstimateTo — Adds worklog and sets remaining time to the value of setTo.
- getTimeSpent — Gets the time spent (logged) on an issue by a certain user or group.
- getWorkingDaysPerWeek — Gets the number of working days per week as configured in Jira.
- getWorkingHoursPerDay — Gets the number of working hours per day as configured in Jira.
- getWorkingInterval — Returns the number of working hours from a time interval.
- getWorklogAuthor — Returns the author of a worklog.
- getWorklogComment — Returns the comment associated with the worklog.
- getWorklogCreatedDate — Returns the created date of a worklog.
- getWorklogIds — Returns an array with the ids of the worklogs for the specified date and issue.
- getWorklogIdsForUser — Returns an array with the ids of the worklogs for the specified user and issue.
- getWorklogLoggedHours — Returns the logged hours for a worklog.
- getWorklogsForIssues — Returns an array with the worklogs for the specified list of issues, and if exists for given user also.
- getWorklogStartDate — Returns the start date of a worklog.
- getWorklogUpdateAuthor — Returns the author who last updated the worklog.
- getWorklogUpdatedDate — Returns the last date when the worklog was updated.
- removeWorklogIncreaseEstimateBy — Removes the worklog and the Remaining time will be increased by the value of increaseBy.
- removeWorklogSetEstimateTo — Removes the worklog and sets Remaining time to the value of setTo.
- updateWorklogAdjustEstimate — Updates the worklog and the Remaining time will be adjusted with the value of interval, but never below 0.
- updateWorklogExistingEstimate — Updates the worklog and keeps the same Remaining time.
- updateWorklogSetEstimateTo — Updates the worklog and keeps the same Remaining time.