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>.
Comment Routines
- addComment — Posts 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. Optional, you can edit the security level for comment. Returns the comment representation after the edit.
- getAllCommentIds — Gets all the comment ids that are already entered on an issue.
- getAllUsers — Returns a list of all active and inactive users in Jira.
- 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.
- getLastComment — Gets all the comment properties for the last issue comment.
Custom Field Routines
- addComment — Posts 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. Optional, you can edit the security level for comment. Returns the comment representation after the edit.
- getAllCommentIds — Gets all the comment ids that are already entered on an issue.
- getAllUsers — Returns a list of all active and inactive users in Jira.
- 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.
- getLastComment — Gets all the comment properties for the last issue comment.
Group Routines
- allGroups — Returns the list of group names that exist in the Jira environment.
- groupExists — Verifies if the selected group is a registered Jira group.
- groupsInRole
Issue Routines
- 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.
- getIssueEntityPropertyValue
- getIssueURL — Returns the url of the 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 (array of JFieldChange https://appfire.atlassian.net/wiki/display/SIL/Predefined+structure+types#Predefinedstructuretypes-JFieldChange) from the selected issue's history.
- moveIssue
- 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.
- setIssueEntityPropertyValue
- subtasks — Get the list of sub tasks linked to the parent issue.
Link Routines
- allLinkedIssues — Returns an array with the issue names linked with the specified issue, including the system links (subtask, issue in epic).
- 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
- 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.
- getStatusCategory — Gets the category of the status for the given issue.
- 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.
User Routines
- accountIdToDisplayName — Returns the display name for the provided user key.
- accountIdToUsername — Returns the username for the provided account id.
- 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.
- getUser — Gets the user by username or key.
- getUserByEmail — Gets the user by email address.
- getUserByFullName — Gets the user by full name.
- getUserDirectoryName — Returns the directory name the user belongs to.
- getUserKeysFromEmails — Finds the corresponding user keys for a list of email addresses.
- getUserProperty — Retrieves properties of users created and maintained in Jira (user properties https://confluence.atlassian.com/x/8YxjL).
- 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 created and maintained in Jira (user properties https://confluence.atlassian.com/x/8YxjL).
- 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.
- userGroups — Returns the groups the selected user belongs to.
- userHasAccessToComment — Verifies if a comment is visible for an user.
- userInGroup — Verifies if the selected user is in the selected group(s).
- userKeyToDisplayName — Returns the display name for the provided user key.
- userKeyToUsername — Returns the username for the provided user key.
- userLanguage — Returns the language for an user.
- userLocale — Returns the locale for a user.
- usernameToAccountId — Returns the account id for the provided username.
- 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.
- 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.
Workflow Routines
- autotransition — Executes a transition and moves to the specified step. It will execute the transition only if the transition is valid for the current status of the issue.
- getAllWorkflows — Retrieves a list of all workflows in the Jira environment.
- getAllWorkflowSchemeNames — Retrieves a list of Workflow Scheme names in a Jira environment.
- getAllWorkflowTransitions — Retrieves a list of workflow transition actions.
- 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.
- getWorkflowsFromSchemeName — Retrieves a list of workflows associated to a workflow scheme.
- 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
- 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.
- removeWorklogAdjustEstimate — Removes the worklog and the Remaining will be increased by the time from the worklog.
- removeWorklogExistingEstimate — Removes the worklog and keeps Remaining time the same.
- 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.