API Documentation¶
endpoint¶
This is an alias to the EndPoints class and it has many methods that can be called directly.
You can access this classmethod by calling jiraone.endpoint.
from jiraone import LOGIN
user = "email"
password = "token"
link = "https://yourinstance.atlassian.net"
LOGIN(user=user, password=password, url=link)
def priorities():
load = LOGIN.get(endpoint.get_all_priorities())
if load.status_code == 200:
# some expression here
...
- class jiraone.access.EndPoints¶
A Structural way to dynamically load urls that is fed to other functions.
- classmethod add_customers(service_desk_id)¶
Adds one or more customers to a service desk.
If any of the passed customers are associated with the service desk, no changes will be made for those customers and the resource returns a 204 success code.
- Request POST
- Parameters
service_desk_id –
required
- body param
usernames, accountIds, datatype -> Array<string>
- Returns
A string of the url
- Return type
str
- classmethod add_sd_organization(service_desk_id)¶
This method adds an organization to a service desk.
If the organization ID is already associated with the service desk, no change is made and the resource returns a 204 success code.
- Request POST
- Parameters
service_desk_id – required
- Body param
organizationId, datatype -> integer
- Returns
A string of the url
- Return type
str
- classmethod add_users_to_organization(org_id)¶
This method adds users to an organization.
- Request POST
- Parameters
org_id – required
- Body param
usernames, accountIds, datatypes -> Array<string>
- Returns
A string of the url
- Return type
str
- classmethod comment(query=None, key_or_id=None, start_at=0, max_results=50, ids=None, event=False)¶
Create, update, delete or get a comment.
- :request POST - Returns a paginated list of just the comments for a list of comments specified by comment IDs.
- param query
datatype -> string
- query param
expand datatype -> string
available options below
renderedBody Returns the comment body rendered in HTML.
properties Returns the comment’s properties.
- body param - ids
datatype -> Array<integer>
The list of comment IDs. A maximum of 1000 IDs can be specified.
:request GET - Returns all comments for an issue.
- param key_or_id
datatype -> string required
- param start_at
datatype -> integer defaults to 0
- param max_results
datatyoe -> integer defaults to 50
- query param
orderBy datatype -> string Valid values: created, -created, +created
- :request POST - Adds a comment to an issue.
key_or_id required :param event datatype -> boolean
defaults to false, set to true to add a comment to an issue.
- query param
expand
- body param
body datatype -> Anything visibility -> The group or role to which this comment is visible. Optional on create and update. properties datatype -> Array<EntityProperty>
A list of comment properties. Optional on create and update.
Additional Properties datatype ->anything
- :request GET - Returns a comment.
- param ids
datatype integers - The ID of the comment.
- query param
expand
- :request PUT - Updates a comment.
key_or_id required ids The ID of the comment. :query param: expand
- body param
body datatype -> Anything visibility -> The group or role to which this comment is visible. Optional on create and update. properties datatype -> Array<EntityProperty>
A list of comment properties. Optional on create and update.
Additional Properties datatype ->anything
- :request DELETE - Deletes a comment.
key_or_id required ids required
- Returns
A string of the url
- Parameters
query (Optional[str]) –
key_or_id (Optional[str]) –
start_at (int) –
max_results (int) –
ids (Optional[int]) –
event (bool) –
- Return type
str
- classmethod create_board()¶
Creates a new board. Board name, type and filter ID is required.
- Request POST
- Body param
name, type, datatype -> string : filterId, datatype -> integer : location, datatype -> object
- Returns
A string of the url
- Return type
str
- classmethod create_customer()¶
This method adds a customer to the Jira Service Management.
instance by passing a JSON file including an email address and display name.
:request POST
- Body param
email, displayName, datatype -> string
- Returns
A string of the url
- Return type
str
- classmethod create_organization()¶
This method creates an organization by passing the name of the organization.
- Request POST
- Body param
name, datatype -> string
- Returns
A string of the url
- Return type
str
- classmethod create_sprint()¶
Creates a future sprint. Sprint name and origin board id are required.
Start date, end date, and goal are optional. :request POST:
- Body param
name, startDate, endDate, goal, datatype -> string : originBoardId, datatype -> integer
- Returns
A string of the url
- Return type
str
- classmethod delete_organization(org_id)¶
This method deletes an organization.
Note that the organization is deleted regardless of other associations it may have. For example, associations with service desks.
- Request DELETE
- Parameters
org_id – required
- Returns
A string of the url
- Return type
str
- classmethod delete_sprint(sprint_id)¶
Deletes a sprint.
Once a sprint is deleted, all open issues in the sprint will be moved to the backlog. :request DELETE: :param sprint_id: required
- Returns
A string of the url
- Return type
str
- classmethod find_users_with_permission(*args)¶
Find users with permissions to a Project.
- Parameters
args – 1st accountId 2nd projectKey 3rd permissions that needs checking all in caps e.g “BROWSE”, “CREATE_ISSUE” etc
- Returns
A string of the url
- Return type
str
- classmethod get_all_application_role()¶
Returns all application roles.
In Jira, application roles are managed using the Application access configuration page.
- Returns
A string of the url
- Return type
str
- classmethod get_all_issue_security_scheme()¶
Returns all issue security schemes.
- Returns
A string of the url
- Return type
str
- classmethod get_all_issue_type_schemes(query=None, start_at=0, max_results=50)¶
- Returns a paginated list of issue type schemes.
Only issue type schemes used in classic projects are returned
- Parameters
query (Optional[str]) – A search term
start_at – A row record
max_results – A maximum number to display
- Returns
A string of the url
- Return type
str
- classmethod get_all_issue_types()¶
Returns all issue types.
If the user has the Administer Jira global permission, all issue types are returned.
If the user has the Browse projects project permission for one or more projects, the issue types associated with the projects the user has permission to browse are returned.
- Returns
A string of the url
- Return type
str
- classmethod get_all_permission_scheme(query=None)¶
Returns all permission schemes.
- Parameters
query (Optional[str]) – A search term for this resource.
- Returns
A string of the url
- Return type
str
- classmethod get_all_priorities()¶
Returns the list of all issue priorities.
- Returns
A string of the url
- Return type
str
- classmethod get_all_quick_filters(board_id, start_at=0, max_results=50)¶
Returns all quick filters from a board, for a given board ID.
- Parameters
board_id – required
start_at (int) – defaults 0
max_results (int) – defaults 50
- Returns
A string of the url
- Return type
str
- classmethod get_all_sprints(board_id, query=None, start_at=0, max_results=50)¶
Get all Sprint on a Board.
- Parameters
board_id – A board id
start_at (int) – defaults to 0
max_results (int) – defaults to 50
query (Optional[str]) – A search term
- Returns
A string of the url
- Return type
str
- classmethod get_attachment_meta_data(query, warning=None)¶
Returns the metadata for an attachment. Note that the attachment itself is not returned.
- Parameters
query (str) – of the attachment
warning (Optional[Any]) – deprecation notice
- Return type
str
Use issue search endpoint in conjunction to grab the attachment id
- Returns
A string of the url
- Parameters
query (str) –
warning (Optional[Any]) –
- Return type
str
- classmethod get_board(board_id)¶
Returns the board for the given board ID.
This board will only be returned if the user has permission to view it. Admins without the view permission will see the board as a private one, so will see only a subset of the board’s data (board location for instance).
- Parameters
board_id – A board id
- Returns
A string of the url
- Return type
str
- classmethod get_board_by_filter_id(filter_id, start_at=0, max_results=50)¶
Returns any boards which use the provided filter id.
This method can be executed by users without a valid software license in order to find which boards are using a particular filter.
:param filter_id required
Filters results to boards that are relevant to a filter. Not supported for next-gen boards.
:param start_at defaults to 0
:param max_results defaults to 50
- Returns
A string of the url
- Parameters
start_at (int) –
max_results (int) –
- Return type
str
- classmethod get_customers(service_desk_id, start=0, limit=50, query=None)¶
This method returns a list of the customers on a service desk.
The returned list of customers can be filtered using the query parameter. The parameter is matched against customers’ displayName, name, or email. This API is experimental
- Parameters
service_desk_id – required
start (int) – defaults to 0
limit (int) – defaults to 50
query (Optional[str]) – datatype string.
- Returns
A string of the url
- Return type
str
- classmethod get_dashboard(dashboard_id)¶
Gets the dashboard.
- Parameters
dashboard_id (int) – An id for the dashboard
- Returns
A string of the url
- Return type
str
- classmethod get_field(query=None, start_at=0, max_results=50, system=None)¶
Returns a paginated list of fields for Classic Jira projects. The list can include:
- Parameters
query (Optional[str]) – accepted options -> string type=custom (use to search for custom fields)
start_at (int) – defaults to 0
max_results (int) – defaults to 50
system (Optional[str]) – string accepts any string e.g. field (use any string to denote as system)
- Return type
str
all fields.
specific fields, by defining id.
fields that contain a string in the field name or description, by defining query.
specific fields that contain a string in the field name or description, by defining id and query.
Only custom fields can be queried, type must be set to custom.
Find system fields
Fields that cannot be added to the issue navigator are always returned.
Fields that cannot be placed on an issue screen are always returned.
Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking fields, subtasks, votes, and watches.
For all other fields, this operation only returns the fields that the user has permission to view
(that is, the field is used in at least one project that the user has Browse Projects project permission for.)
- return
A string of the url
- classmethod get_issues_on_backlog(board_id, query=None, start_at=0, max_results=50)¶
Returns all issues from the board’s backlog, for the given board ID.
This only includes issues that the user has permission to view. The backlog contains incomplete issues that are not assigned to any future or active sprint.
- Parameters
board_id – required
start_at (int) – defaults to 0,
max_results (int) – defaults to 50
query (Optional[str]) –
-> includes other query parameters such as
Query Datatypes
jql | string validateQuery | boolean fields | Array<string> expand | string
- Returns
A string of the url
- Return type
str
- classmethod get_issues_on_board(board_id, query=None, start_at=0, max_results=50)¶
Returns all issues from a board, for a given board ID.
This only includes issues that the user has permission to view. An issue belongs to the board if its status is mapped to the board’s column.
- Parameters
board_id – required
start_at (int) – defaults to 0,
max_results (int) – defaults to 50
query (Optional[str]) –
-> includes other query parameters such as
Query Datatypes
jql | string validateQuery | boolean fields | Array<string> expand | string
- Returns
A string of the url
- Return type
str
- classmethod get_organization(org_id)¶
This method returns details of an organization.
Use this method to get organization details whenever your application component is passed an organization ID but needs to display other organization details.
- Parameters
org_id – required
- Returns
A string of the url
- Return type
str
- classmethod get_organizations(start=0, limit=50, account_id=None)¶
This method returns a list of organizations in the Jira Service Management instance.
Use this method when you want to present a list of organizations or want to locate an organization by name.
- Parameters
start (int) – defaults to 0
limit (int) – defaults to 50
account_id (Optional[str]) – datatype string. e.g. 5b10ac8d82e05b22cc7d4ef5
- Returns
A string of the url
- Return type
str
- classmethod get_project_component(id_or_key)¶
Returns all components in a project. See the Get project components paginated
resource if you want to get a full list of components with pagination. The project ID or project key (case sensitive).
- Parameters
id_or_key – An issue key or id
- Returns
A string of the url
- Return type
str
- classmethod get_project_role(*args)¶
Returns a project role’s details and actors associated with the project.
- Parameters
args – projectKey or Id of the Project id of the role
- Returns
A string of the url
- Return type
str
- classmethod get_projects(*args, start_at=0, max_results=50)¶
Return a list of Projects available on an Instance
How to use this endpoint /rest/api/3/project/search is mentioned here https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/
#api-rest-api-3-project-search-get
- Parameters
args (Any) –
Query Parameters that are useful mostly. a) query, example: query=key,name {caseInsensitive} b) searchBy, example: searchBy=key,name c) action, example: action=browse
available options [view, browse, edit]
- status example: status=live
available options [live, archived, deleted]
- e). expand, example: expand=insight
available options [insight, description, projectKeys, url, issueTypes, lead]
start_at – defaults as keyword args,example startAt=0
max_results – defaults as keyword args, example maxResults=50
- Returns
A string of the url
- Return type
str
- classmethod get_projects_on_board(board_id, start_at=0, max_results=50)¶
Returns all projects that are associated with the board, for the given board ID.
If the user does not have permission to view the board, no projects will be returned at all. Returned projects are ordered by the name.
- Parameters
board_id – required
start_at (int) – defaults 0
max_results (int) – defaults 50
- Returns
A string of the url
- Return type
str
- classmethod get_quick_filter(board_id, quick_filter_id)¶
Returns the quick filter for a given quick filter ID.
The quick filter will only be returned if the user can view the board that the quick filter belongs to.
- Parameters
board_id – required,
quick_filter_id – required
- Returns
A string of the url
- Return type
str
- classmethod get_resolutions()¶
Returns a list of all issue resolution values. :return: A string of the url
- Return type
str
- classmethod get_roles_for_project(id_or_key)¶
Returns a list of project roles for the project returning the name and self URL for each role.
- Parameters
id_or_key (Any) – An issue key or id
- Returns
A string of the url
- Return type
str
- classmethod get_sd_by_id(service_desk_id)¶
This method returns a service desk. Use this method to get service desk details whenever your application component is passed a service desk ID but needs to display other service desk details.
- Parameters
service_desk_id – The ID of the service desk to return. Required
- Returns
string
- Return type
str
- classmethod get_sd_organizations(service_desk_id, start=0, limit=50, account_id=None)¶
This method returns a list of all organizations associated with a service desk.
- Parameters
service_desk_id – required
start (int) – defaults to 0
limit (int) – defaults to 50
account_id (Optional[str]) – datatype string. e.g. 5b10ac8d82e05b22cc7d4ef5
- Returns
A string of the url
- Return type
str
- classmethod get_server_info()¶
This method retrieves information about the Jira Service Management.
instance such as software version, builds, and related links.
- Returns
A string of the url
- Return type
str
- classmethod get_service_desks(start=0, limit=100)¶
This method returns all the service desks in the Jira Service Management instance that the user has permission to access. Use this method where you need a list of service desks or need to locate a service desk by name or keyword.
- Parameters
start (int) – integer - pagination row
limit (int) – integer - limit to each pagination
- Returns
string
- Return type
str
- classmethod get_sprint(sprint_id)¶
Returns the sprint for a given sprint ID.
The sprint will only be returned if the user can view the board that the sprint was created on, or view at least one of the issues in the sprint.
- Parameters
sprint_id – required
- Returns
A string of the url
- Return type
str
- classmethod get_user_group(account_id)¶
Search for the groups a user belongs to
- Parameters
account_id (Any) – An alphanumeric required string
- Returns
A string of the url
- Return type
str
- classmethod get_users_in_organization(org_id, start=0, limit=50)¶
This method returns all the users associated with an organization.
Use this method where you want to provide a list of users for an organization or determine if a user is associated with an organization.
- Parameters
org_id – required
start (int) – datatype integer
limit (int) – datatype integer
- Returns
A string of the url
- Return type
str
- classmethod group_jira_users(group_name, account_id=None)¶
Used for addition and removal of users to and from groups.
- :request POST - Adds a user to a group.
- query param
groupname required, datatype -> string
- body param
name, accountId, datatype -> string
returns 201 if successful
- : DELETE - Removes a user from a group.
- query param
group_name required, account_id required, datatype -> string
returns 200 if successful
- param group_name
name of group
- param account_id
string of a user account
- Returns
A string of the url
- Parameters
group_name (str) –
account_id (Optional[str]) –
- Return type
str
- classmethod issue_attachments(id_or_key=None, attach_id=None, uri=None, query=None)¶
Returns the attachment content.
:request GET - Get Jira attachment settings Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed.
:request GET - Get attachment Meta data
Returns the metadata for an attachment. Note that the attachment itself is not returned.
- Parameters
attach_id (Optional[str]) –
- required (id of the attachment), datatype -> string
:request DELETE - Deletes an attachment from an issue.
attach_id required (id of the attachment), datatype -> string
:request GET - Get all metadata for an expanded attachment
:param query:, datatype -> string
- available options
- expand/human -Returns the metadata for the contents of an attachment, if it is an archive,
and metadata for the attachment itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is returned and metadata for the ZIP archive.
- expand/raw - Returns the metadata for the contents of an attachment, if it is an archive.
For example, if the attachment is a ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is supported.
:request POST - Adds one or more attachments to an issue. Attachments are posted as multipart/form-data
id_or_key (Optional[str]) –
uri (Optional[str]) –
query (Optional[str]) –
- Return type
str
:request POST - Adds one or more attachments to an issue. Attachments are posted as multipart/form-data
- Parameters
id_or_key (Optional[str]) – required, datatype -> string
uri (Optional[str]) – various endpoint to attachment
attach_id (Optional[str]) –
query (Optional[str]) –
- Return type
str
The ID or key of the issue that attachments are added to.
- Returns
A string of the url
- Parameters
id_or_key (Optional[str]) –
attach_id (Optional[str]) –
uri (Optional[str]) –
query (Optional[str]) –
- Return type
str
- classmethod issues(issue_key_or_id=None, query=None, uri=None, event=False)¶
Creates issues, delete issues, bulk create issue, transitions.
A transition may be applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties set.
:request POST - Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask.
- Parameters
uri (Optional[str]) –
datatype -> string
available options [bulk, createmeta]
e.g. endpoint: /rest/api/3/issue/bulk
e.g. endpoint /rest/api/3/issue/createmeta
query (Optional[Any]) –
datatype -> string
use the query keyword argument and structure a parameter
e.g. query=”notifyUsers=false”
OR in the case of changelog the endpoint of “changelog”
event (bool) –
datatype -> boolean
determine if you can get a changelog from the issue. default is false
if True required parameters are: :param issue_key_or_id: :param query:
/rest/api/3/issue/{issueIdOrKey}/changelog
issue_key_or_id (Optional[Any]) –
-> string or integer
The body parameter has to be a bundled data that should be posted to the desired endpoint.
- query param
updateHistory, datatype -> boolean
- body param
transition, fields, update, historyMetadata, datatype -> object : properties, datatype -> Array<EntityProperty> : Additional Properties, datatype -> Any
- POST - Bulk create issue
Creates issues and, where the option to create subtasks is enabled in Jira, subtasks.
- body param
issueUpdates, datatype -> Array<IssueUpdateDetails> : Additional Properties, datatype -> Any
GET - Create issue metadata Returns details of projects, issue types within projects, and, when requested, the create screen fields for each issue type for the user.
- query param
projectIds, projectKeys, issuetypeIds, issuetypeNames, datatype -> Array<string> : expand, datatype -> string
GET - Get issue Return the details of an issue endpoint /rest/api/3/issue/{issueIdOrKey}
- query param
issue_key_or_id required : fields, properties, datatype -> Array<string> : fieldsByKeys, updateHistory, datatype -> boolean : expand, datatype -> string
PUT - Edits an issue. A transition may be applied and issue properties updated as part of the edit. endpoint /rest/api/3/issue/{issueIdOrKey}
- query param
issue_key_or_id required : notifyUsers, overrideScreenSecurity, overrideEditableFlag, datatype -> boolean
- body param
transition, fields, update, historyMetadata, properties, Additional Properties, datatype -> object
DELETE - Deletes an issue. endpoint /rest/api/3/issue/{issueIdOrKey}
- query param
issue_key_or_id required : deleteSubtasks, datatype -> string, values = (true | false)
- Returns
A string of the url
- Return type
str
- classmethod jira_group(group_name=None, swap_group=None)¶
Used for Creation and deletion of Jira groups.
- :request POST - Creates a group.
- body param
name required, datatype -> string
returns 201 if successful
- : DELETE - Deletes a group.
The group to transfer restrictions to. Only comments and worklogs are transferred. If restrictions are not transferred, comments and worklogs are inaccessible after the deletion.
- query param
group_name required, swap_group, datatype -> string
returns 200 if successful
- param group_name
name of group
- param swap_group
group name to swap
- Returns
A string of the url
- Parameters
group_name (Optional[str]) –
swap_group (Optional[str]) –
- Return type
str
- classmethod jira_user(account_id=None)¶
API for User creation, deletion and retrieval.
- :request POST - Creates a user. This resource is retained for legacy compatibility.
As soon as a more suitable alternative is available this resource will be deprecated
- body param
key, name, password, emailAddress, displayName, notification, datatypes -> string : applicationKeys, datatype -> Array<string> : Additional Properties, datatypes -> Any
returns 201 for successful creation
- :DELETE - Deletes a user.
- body param
accountId, datatype -> string required
returns 204 for successful deletion
:GET - Returns a user.
- body param
accountId, expand, datatypes -> string
- param account_id
string for a user account
- Returns
A string of the url
- Parameters
account_id (Optional[str]) –
- Return type
str
- classmethod move_issues_to_backlog()¶
Move issues to the backlog.
This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may be moved at once.
:request POST :body param: issues, datatype -> Array<string> Send a POST request within API.
- Returns
A string of the url
- Return type
str
- classmethod move_issues_to_backlog_from_board(board_id)¶
Move issues to the backlog of a particular board (if they are already on that board).
This operation is equivalent to remove future and active sprints from a given set of issues if the board has sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most 50 issues may be moved at once.
- Request POST
- Parameters
board_id – required
- Body param
issues, datatype -> Array<string>, : rankBeforeIssue, rankAfterIssue, type -> string : rankCustomFieldId, type -> integer
- Returns
A string of the url
- Return type
str
- classmethod move_issues_to_board(board_id)¶
Move issues from the backog to the board (if they are already in the backlog of that board).
This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) Or transitions the issue(s) to the first column for a kanban board with backlog.
- Request POST
- Parameters
board_id – required
- Body param
rankBeforeIssue, rankAfterIssue, datatype -> string : rankCustomFieldId, datatype -> integer : issues, datatype -> Array<string>
- Returns
A string of the url
- Return type
str
- classmethod myself()¶
Return data on your own user.
- Returns
A string of the url
- Return type
str
- classmethod projects(id_or_key, query=None, uri=None, enable_undo=None)¶
Create, delete, update, archive, get status.
- Request
POST - for project creations. The project types are available according to the installed Jira features as follows:
- Parameters
id_or_key –
required
- param uri
optional for accessing other project endpoints -> string
endpoint: /rest/api/3/project/{projectIdOrKey}/{archive} available options [archive, delete, restore, statuses]
archive - Archives a project. Archived projects cannot be deleted.
delete - Deletes a project asynchronously.
restore - Restores a project from the Jira recycle bin.
statuses - Returns the valid statuses for a project.
query (Optional[str]) –
uri (Optional[str]) –
enable_undo (Optional[bool]) –
- Return type
str
see:https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-post
- body param
projectTypeKey and projectTemplateKey required, datatype -> string : name, key, description, leadAccountId, url, assigneeType, datatype -> string : avatarId, issueSecurityScheme, permissionScheme, notificationScheme, categoryId,
datatype -> integer
: GET - Returns the project details for a project. This operation can be accessed anonymously.
- query param
expand, datatype -> string
: properties, datatype -> Array<string>
: PUT - Updates the project details for a project.
- param query
expand, datatype -> string
- body param
projectTypeKey and projectTemplateKey required, datatype -> string : name, key, description, leadAccountId, url, assigneeType, datatype -> string : avatarId, issueSecurityScheme, permissionScheme, notificationScheme, categoryId,
datatype -> integer
: DELETE - Deletes a project.
- param enable_undo
datatype -> boolean
- Returns
A string of the url
- Parameters
query (Optional[str]) –
uri (Optional[str]) –
enable_undo (Optional[bool]) –
- Return type
str
- classmethod remove_customers(service_desk_id)¶
This method removes one or more customers from a service desk.
The service desk must have closed access. If any of the passed customers are not associated with the service desk, no changes will be made for those customers and the resource returns a 204 success code.
- Request DELETE
- Parameters
service_desk_id –
required
- body param
usernames, accountIds, datatype -> Array<string>
- Returns
A string of the url
- Return type
str
- classmethod remove_sd_organization(service_desk_id)¶
This method removes an organization from a service desk.
If the organization ID does not match an organization associated with the service desk, no change is made and the resource returns a 204 success code.
- Request DELETE
- Parameters
service_desk_id – required
- Body param
organizationId, datatype -> integer
- Returns
A string of the url
- Return type
str
- classmethod remove_users_from_organization(org_id)¶
This method removes users from an organization.
- Request DELETE
- Parameters
org_id – required
- Body param
usernames, accountIds, datatypes -> Array<string>
- Returns
A string of the url
- Return type
str
- classmethod search_all_notification_schemes(query=None, start_at=0, max_results=50)¶
Returns a paginated list of notification schemes ordered by display name.
- Parameters
query (Optional[str]) – 1st String value for expand= {all, field, group, user, projectRole, notificationSchemeEvents}
start_at – has default value of 0
max_results – has default value of 50
- Returns
A string of the url
- Return type
str
- classmethod search_all_screens(query=0)¶
Returns a paginated list of all screens or those specified by one or more screen IDs.
- Parameters
query (int) –
has default value of 0
maxResults=100 (default)
- Returns
A string of the url
- Return type
str
- classmethod search_all_workflow_schemes(query=0)¶
Returns a paginated list of all workflow schemes, not including draft workflow schemes.
- Parameters
query (int) –
has default value of 0
filled - maxResults=50 (default)
- Returns
A string of the url
- Return type
str
- classmethod search_all_workflows(query=0)¶
Returns a paginated list of published classic workflows. When workflow names are specified.
details of those workflows are returned. Otherwise, all published classic workflows are returned. This operation does not return next-gen workflows.
- Parameters
query (int) –
has default value of 0
filled - maxResults=50 (default)
- Returns
A string of the url
- Return type
str
- classmethod search_for_dashboard(query=None, start_at=0)¶
Returns a paginated list of dashboards. This operation is similar to
Get dashboards except that the results can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. When multiple attributes are specified only filters matching all attributes are returned.
- Parameters
query (Optional[str]) – 1st String value dashboardName, accountId, owner, groupname, projectId
start_at (int) – has default value of 0
- Param
filled: - maxResult=20 (default)
- Returns
A string of the url
- Return type
str
- classmethod search_for_filters(query=None, start_at=0)¶
Returns a paginated list of filters. Use this operation to get:
specific filters, by defining id only.
filters that match all of the specified attributes. For example, all filters
for a user with a particular word in their name. When multiple attributes are specified only filters matching all attributes are returned.
- Parameters
query (Optional[str]) – 1st String value filterName, accountId, owner, groupname, projectId
start_at (int) – has default value of 0
- Param
filled: - maxResults=50 (default)
- Returns
A string of the url
- Return type
str
- classmethod search_for_screen_schemes(query=0)¶
Returns a paginated list of screen schemes.
Only screen schemes used in classic projects are returned.
- Parameters
query (int) –
has default value of 0
maxResults=25 (default)
- Returns
A string of the url
- Return type
str
- classmethod search_issues_jql(query, start_at=0, max_results=50)¶
Searches for issues using JQL.
- Parameters
query – A search term.
start_at (int) – A record start row
max_results (int) – A max result to return
- Returns
A string of the url
- Return type
str
- classmethod search_users(query=0)¶
Search multiple users and retrieve the data
- Parameters
query (int) – An integer record row
- Returns
A string of the url
- Return type
str
- classmethod update_sprint(sprint_id)¶
Performs a full update of a sprint.
A full update means that the result will be exactly the same as the request body. Any fields not present in the request JSON will be set to null.
- Request PUT
- Parameters
sprint_id – required
- Body param
name, state, startDate, endDate, goal, self (format: uri), completeDate, datatype -> string : id, originBoardId, datatype -> integer
- Returns
A string of the url
- Return type
str
LOGIN¶
This is a call to the Credentials class. The way to use this class is to make a call to
LOGIN
from jiraone import LOGIN
user = "email"
password = "token"
link = "https://yourinstance.atlassian.net"
LOGIN(user=user, password=password, url=link)
Once a login session starts, you can join other classes and make a call directly to other objects.
from jiraone import LOGIN, endpoint
# previous login statement
LOGIN.get(endpoint.myself())
- class jiraone.access.Credentials(user, password, url=None)¶
class.Credentials -> used for authentication of the user to the Instance.
- Parameters
user (str) –
password (str) –
url (str) –
- Return type
None
- delete(url, **kwargs)¶
A delete request to HTTP request.
- Parameters
url – A valid URL
kwargs – Additional keyword arguments to
requestsmodule
- Returns
A HTTP response
- Return type
requests.models.Response
- get(url, *args, payload=None, **kwargs)¶
A get request to HTTP request.
- Parameters
url – A valid URL
args – Additional arguments if any
payload – A JSON data representation
kwargs – Additional keyword arguments to
requestsmodule
- Returns
A HTTP response
- Return type
requests.models.Response
- post(url, *args, payload=None, **kwargs)¶
A post request to HTTP request.
- Parameters
url – A valid URL
args – Additional arguments if any
payload – A JSON data representation
kwargs – Additional keyword arguments to
requestsmodule
- Returns
A HTTP response
- Return type
requests.models.Response
- put(url, *args, payload=None, **kwargs)¶
A put request to HTTP request.
- Parameters
url – A valid URL
args – Additional arguments if any
payload – A JSON data representation
kwargs – Additional keyword arguments to
requestsmodule
- Returns
A HTTP response
- Return type
requests.models.Response
- token_session(email=None, token=None)¶
A session initializer to HTTP request.
- Parameters
email (Optional[str]) – An email address or username
token (Optional[str]) – An API token or user password
- Returns
None
- Return type
None
field¶
Alias to the Field class and it basically helps to update custom or system fields on Jira.
You can access this class and make updates to Jira fields.
from jiraone import LOGIN, field, echo
# previous login statement
issue = "T6-75"
fields = "Multiple files" # a multiselect custom field
case_value = ["COM Row 1", "Thanos"]
for value in case_value:
c = field.update_field_data(data=value, find_field=fields, key_or_id=issue, options="add", show=False)
echo(c)
- class jiraone.access.Field¶
Field class helps with Jira fields.
It helps with posting, putting and getting various fields or field type.
It comes with two attributes * field_type * field_search_key
- static cascading(data=typing.Any)¶
Transform a string or a list into a cascading select type.
- Parameters
data (Any) – A string or list content
- Returns
A list object or none.
- Return type
Any
- static data_load(data=typing.Any, s=None)¶
Process the received data into a dict.
- Parameters
s (Optional[Any]) – Any object to change s to not None
data (Any) – any object
- Returns
A dictionary content
- Return type
Dict
- static extract_issue_field_options(key_or_id=None, search=None, amend=None, data=typing.Any)¶
Get the option from an issue.
Use this method to extract and amend changes to system fields such as Components or fix versions, labels or custom fields such a multicheckboxes or multiselect.
- Parameters
key_or_id (Optional[Union[str, int]]) – datatype[String, Integer] issue key or id of an issue.
search (Optional[Dict]) – datatype[Dict] issue data of an issue or issue payload.
amend (Optional[str]) – datatype[String] available option “add” or “remove” condition to decide action for appending.
data (Any) – datatype[string] our object data that will be processed.
- Returns
List or None
- Return type
Any
- get_all_field_value(field_set, key)¶
Return all the field present on an issue.
- Parameters
field_set (Mapping) –
key (Union[str, int]) –
- Returns
Any
- Return type
Any
- static get_field(find_field=None)¶
Search for system fields or custom fields.
- Parameters
find_field (Optional[str]) – A field name to search.
- Returns
A dictionary if field is found else None
- Return type
Any
- get_field_value(name, keys)¶
Return the value of a field on an issue.
- Parameters
name (str) – The name of a field.
keys (Union[str, int]) – The issue key or issue id of an issue.
- Returns
Any datatype is returned
- Return type
Any
- static multi_field(data=typing.Any, s='value')¶
Transform any given string separated by comma into an acceptable multi value string.
- Parameters
data (Any) – any string object data.
s (str) –
is a placeholder to determine the object key.
e.g. required output [{“value”: “hello”}] -> for Multicheckboxes type of field.
e.g. required output [{“name”: “hello”}] -> for Components or Fix versions type of field.
- Returns
A list of data
- Return type
List
- static search_field(find_field=None)¶
Search for custom fields.
- Parameters
find_field (Optional[str]) – A field name to search.
- Returns
A dictionary if field is found else None
- Return type
Any
- update_field_data(data=None, find_field=None, field_type='custom', key_or_id=None, show=True, **kwargs)¶
Field works for.
All field types mentioned on the Field class attributes.
:request PUT
- Parameters
data (Optional[Any]) – datatype[Any] the data you’re trying to process, depending on what field it could be any object.
find_field (Optional[str]) – datatype[String] name of the custom field or system field to find in strings.
field_type (str) – datatype[String] available options - system or custom.
key_or_id (Optional[Union[str, int]]) – datatype[String or Integer] issue key or id of an issue.
show (bool) – datatype[Bool] allows you to print out a formatted field that was searched.
kwargs –
datatype[String] perform other operations with keyword args
options arg is a string and has two values “add” or “remove”.
- query arg is a string and it can have any value that is stated on the endpoint.issue() method
e.g. query=”notifyUsers=false”
- Returns
Any
- Return type
Any
For¶
The
Forclass shows an implementation of aforloop. It comes with a special method that helps with dictionary indexing.
- class jiraone.access.For(data, limit=0)¶
A Class to show the implementation of a ‘for’ loop.
It calls the __iter__ magic method then the __next__ method and raises a StopIteration once it reaches the end of the loop. Datatype expected are list, dict, tuple, str, set or int.
- Parameters
data (Union[list, tuple, dict, set, str, int]) –
limit (int) –
- Return type
None
manage¶
The manage class is a alias to UserManagement class of the management module. It focuses primarily on
user and organization management. The authentication is different as it uses a bearer token.
from jiraone import manage
token = "Edfj78jiXXX"
manage.add_token(token)
- class jiraone.management.UserManagement¶
The UserManagement API is used to access organization profiles on Atlassian sites. The alias to this class is called manage
It comes with the below attributes and methods. >> manage.LINK >> manage.AUTH >> token = YUISNxxx >> manage.api_token(token)
- Return type
None
- add_token(token)¶
Adds a Bearer token to authenticate the API.
- Parameters
token (str) – An API key
- Returns
None
- Return type
None
- api_token(account_id, method='GET', token_id=None)¶
Gets the API tokens owned by the specified user or Deletes a specified API token by ID.
- Parameters
account_id (str) – A user string value for Atlassian accounts
method (str) – A response method condition
token_id (Optional[str]) – A user token id to be deleted.
- Returns
Any
- Return type
Any
- property domain_id¶
Get property of organization domain id
- property event_id¶
Get property of organization event id
- static find_user(query, source=None)¶
Finds a specific user.
- Parameters
query (str) – A search term, could be an email, displayname or accountId if
source (Optional[List]) –
- Return type
Union[Dict, List]
the source data is gotten from self.get_all_users and parameter detail=True
- Parameters
source (Optional[List]) – A list of users
query (str) –
- Returns
A dict of the user data or a list of the data
- Return type
Union[Dict, List]
- get_all_users(source, detail=False)¶
Store all user list from organization, so we can search them by email.
- Parameters
source – A JSON response payload
detail (bool) – Bool defaults to False
- Returns
Deque List
- Return type
collections.deque
- get_organization(org_id=None, filter_by=None, domain_id=None, event_id=None, action=True, policy_id=None, **kwargs)¶
GET request for the organization API.
Returns a list of your organizations (based on your API key).
Returns information about a single organization by ID.
Returns a list of users in an organization.
Returns a list of domains in an organization one page at a time.
Returns information about a single verified domain by ID.
Returns information about a single event by ID.
Returns information about org policies
Returns information about a single policy by ID
- Parameters
org_id (Optional[str]) – Retrieve the organization id from the API key
domain_id (Optional[str]) – Retrieve domain details
filter_by (Optional[str]) –
Use to determine the endpoint to return
- Valid options
> users - return the users in an organization
> domains - list of domains in an organization
> events - list of events in an audit log
> policies - get the policy of the organization
event_id (Optional[str]) – Use to determine the events in the audit log
action (Optional[bool]) –
Additional positional argument for events. True sets events-actions
- > action - Sets the event actions, true to enable by default set to true.
e.g action=True
policy_id (Optional[str]) – An id of the policy
kwargs (Any) –
Optional arguments
- Valid options
Any response argument e.g json=payload
data=payload
- Returns
Any
- Return type
Any
- get_user_permission(account_id, query=None)¶
Returns the set of permissions you have for managing the specified Atlassian account.
- Parameters
account_id (str) – A user string value for Atlassian accounts
query (Optional[list]) –
A query parameter of Array<string>
- Valid options
Valid values: profile, profile.write, profile.read, email.set, lifecycle.enablement, apiToken.read, apiToken.delete
- Returns
Any
- Return type
Any
- manage_organization(org_id, method='POST', policy_id=None, resource_id=None, **kwargs)¶
Create, put and delete organization data
Create a policy for an org Send a post request by using method=”post” as keyword args
Update a policy for an org. Send a put request by using method=”put” as keyword args
You will need to send a payload for the body using the example shown below {
“id”: “<string>”, “type”: “policy”,
- “attributes”: {
- “type”: “ip-allowlist”,
- “name”: “<string>”,
“status”: “enabled”, “rule”: {},
- “resources”: [
{
- “id”: “<string>”,
- “meta”: {
“scheduledDate”: “<string>”, “migrationStartDateTime”: “<string>”,
- “migrationEndDataTime”: “<string>”,
“atlassianAccountId”: “<string>”
}, “links”: {
- “ticket”: “<string>”
}
}
]
}
}
Delete a policy for an org
- Parameters
org_id (Optional[str]) – ID of the organization to create policy for
method (str) –
A response method to set
- Valid options
> PUT - updates resource
> POST - creates resource
> DELETE - removes resources
policy_id (Optional[str]) – ID of the policy
resource_id (Optional[str]) – Resource ID
kwargs (Any) – Additional data to sent in request body
- Returns
Any
- Return type
Any
- manage_profile(account_id, method='GET', **kwargs)¶
Returns information about a single Atlassian account by ID by using a “GET” request.
PATCH request: Updates fields in a user account. The profile.write privilege details which fields you can change.
PUT request: Sets the specified user’s email address. Before using this endpoint, you must verify the target domain
- Parameters
account_id (str) – A user string value for Atlassian accounts
method (str) –
A response method condition
- Available options
GET > Get the return request
- PATCH > Updates a given set of data
Body parameter > Any or all user object this is value e.g. {“name”: “Lila User”, “nickname”: “marshmallow”}
PUT > Change the email account of the user
Body parameter > email - string e.g. {“email”: “prince.nyeche@elfapp.website”}
kwargs (Any) –
Contains other options passed to the requests.<patch>
- Options
json=<variable_name> e.g. payload = {“email”: “prince.nyeche@elfapp.website”} UserManagement.manage_profile(“account_id”, “<method>”, json=payload)
- Returns
Any
- Return type
Any
- manage_user(account_id, disable=True, **kwargs)¶
Disables the specified user account. The permission to make use of this resource is exposed by the lifecycle.enablement privilege.
OR
Enables the specified user account. The permission to make use of this resource is exposed by the lifecycle.enablement privilege.
- Parameters
account_id (str) – A user string value for Atlassian accounts
disable (bool) – A bool option, if True this API url is set to disabled
kwargs –
Additional keyword argument to pass body data
Options available when disable is False e.g. payload = {“message”: “On 6-month suspension”} UserManagement.manage_user(“account_id”, json=payload)
- Returns
Any
- Return type
Any
- property org_id¶
Get property of organization id
- property org_ids¶
Get property of organization ids
- property policy_id¶
Get property of organization policy id
PROJECT¶
This is an alias to the Projects class of the reporting module. It performs various project reporting task and data extraction.
from jiraone import LOGIN, PROJECT
# previous login statement
jql = "project = ABC ORDER BY Rank DESC"
PROJECT.change_log(jql)
- class jiraone.reporting.Projects¶
Get report on a Project based on user or user’s attributes or groups.
- static byte_converter(val)¶
1 Byte = 8 Bits.
using megabyte MB, value is 1000^2 mebibyte MiB, value is 1024^2 Therefore total = val / MB
- Parameters
val – A value to supply
- Returns
strings
- Return type
str
- static bytes_converter(val)¶
Returns unit in KB or MB.
1 Byte = 8 Bits. using megabyte MB, value is 1000^2 mebibyte MiB, value is 1024^2 Therefore total = val / MB
- Parameters
val – An integer value
- Returns
string
- Return type
str
- static change_log(folder='ChangeLog', file='change_log.csv', back_up=False, allow_cp=True, **kwargs)¶
Extract the issue history of an issue.
Query the changelog endpoint if using cloud instance or straight away define access to it on server. Extract the histories and export it to a CSV file.
- Parameters
folder (str) – A name of a folder datatype String
file (str) – A name of a file datatype String
back_up (bool) – A boolean to check whether a history file is exist or not.
allow_cp (bool) – Allow or deny the ability to have a checkpoint.
kwargs (Union[str, bool]) –
The other other kwargs that can be passed as below.
jql: (required) A valid JQL query for projects or issues. datatype -> string
saved_file: The name of the file which saves the iteration. datatype -> string
show_output: Show a printable output on terminal. datatype -> boolean
field_name: Target a field name to render. datatype -> string
- Returns
None
- Return type
None
- comment_on(key_or_id=None, comment_id=None, method='GET', **kwargs)¶
Comment on a ticket or write on a description field.
GET comments POST comments by id PUT update a comment POST add a comment DELETE delete a comment Do the same thing you do via the UI.
- Returns
Any
- Parameters
key_or_id (Optional[str]) –
comment_id (Optional[int]) –
method (str) –
- Return type
Any
- create_issues(*args, csv_file=None, **kwargs)¶
TODO:
- Parameters
csv_file (Optional[Callable]) –
Retrieve the Dashboard Id/Name/owner and who it is shared with.
The only requirement is that the user querying this API should have access to all the Dashboard available else it will only return dashboard where the user’s view access is allowed.
- Parameters
dashboard_folder (str) – A folder
dashboard_file_name (str) – A file to store temp data
kwargs – Additional arguments
- Returns
None
- Return type
None
- static date_converter(val)¶
split the datetime value and output a string.
- Parameters
val – A value to be supplied
- Returns
string
- Return type
str
- static download_attachments(file_folder=None, file_name=None, download_path='Downloads', attach=8, file=6, **kwargs)¶
Download the attachments to your local device read from a csv file.
- we assume you’re getting this from
def get_attachments_on_project()method. - param attach
integers to specify the index of the columns
- param file_folder
a folder or directory where the file
- param download_path
a directory where files are stored
- param file
a row to the index of the column
- param file_name
a file name to a file
- e.g
attach=6,
file=8
the above example corresponds with the index if using the
def get_attachments_on_project()otherwise, specify your value in each keyword args when calling the method.
- Returns
None
- Parameters
file_folder (Optional[str]) –
file_name (Optional[str]) –
download_path (str) –
attach (int) –
file (int) –
- Return type
None
- we assume you’re getting this from
- static extract_jira_issues(*args, **kwargs)¶
Returns all issues within an instance without the 1K limit.
Issue download contains all fields, fields can be specified as well Issue history included as fields Attachments url included as fields All comments included Sprint id and name included User accountId included
- static get_all_roles_for_projects(roles_folder='Roles', roles_file_name='roles_file.csv', user_extraction='role_users.csv', **kwargs)¶
Get the roles available in a project and which user is assigned to which role within the project.
- Parameters
roles_folder (str) – A folder
roles_file_name (str) – A file to store temp data
user_extraction (str) – Data extraction file holder
kwargs – Addition argument
- Returns
None
- Return type
None
- get_attachments_on_projects(attachment_folder='Attachment', attachment_file_name='attachment_file.csv', **kwargs)¶
Return all attachments of a Project or Projects
Get the size of attachments on an Issue, count those attachments collectively and return the total number on all Projects searched. JQL is used as a means to search for the project.
- Parameters
attachment_folder (str) – A temp folder
attachment_file_name (str) – A filename for the attachment
kwargs – Addition argument to supply.
- Returns
None
- Return type
None
- static get_total_comments_on_issues(folder='Comment', file_name='comment_file.csv', **kwargs)¶
Return a report with the number of comments sent to or by a reporter (if any).
This api will return comment count, the total comment sent by a reporter per issue and collectively sum up a total. It also shows how many comments other users sent on the issue.
- Parameters
folder (str) – The name of a folder
file_name (str) – The name of a file
kwargs – additional argument to supply
- Returns
None
- Return type
None
- static grade_and_sort(attach_list, read_file)¶
Arranges and sorts the data.
- Parameters
attach_list – A list of data
read_file – A data set
- Returns
A union of float and integers
- Return type
Union[float, int]
- static move_attachments_across_instances(attach_folder='Attachment', attach_file='attachment_file.csv', key=3, attach=8, file=6, last_cell=True, **kwargs)¶
Ability to post an attachment into another Instance.
- given the data is extracted from a csv file which contains the below information
Issue key
file name
attachment url
we assume you’re getting this from
def get_attachments_on_project()- Parameters
attach_folder (str) – a folder or directory path
attach_file (str) – a file to a file name
key (int) – a row index of the column
attach (int) – a row index of the column
file (int) – integers to specify the index of the columns
last_cell (bool) –
is a boolean determines if the last cell should be counted. e.g
key=3,
attach=6,
file=8
- Return type
None
- the above example corresponds with the index if using the
def get_attachments_on_project()otherwise, specify your value in each keyword args when calling the method.- return
None
- move_projects_across_instances(instance_a=typing.Any, instance_b=typing.Any, extracted_file=typing.Any, method_allowed=False, method_function=typing.Any, properties=typing.Any, classification=typing.Any, diagram=typing.Any, probability=typing.Any, status=typing.Any, **kwargs)¶
Ability to move projects between instances.
Everything within the Project is maintained. Full user permission required, in order to successful transfer and recreate the issue between instances. everything within Instance A project A into Instance B project B is retained.
- Parameters
instance_a (str) –
instance_b (str) –
extracted_file (str) –
method_allowed (bool) –
method_function (Callable) –
properties (Union[float, int]) –
classification (str) –
diagram (List[str]) –
probability (Dict[List[str], int]) –
status (Tuple[List[str]]) –
- static projects_accessible_by_users(*args, project_folder='Project', project_file_name='project_file.csv', user_extraction_file='project_extract.csv', permission='BROWSE', **kwargs)¶
Send an argument as String equal to a value, example: status=live.
Multiple arguments separate by comma as the first argument in the function, all other arguments should be keyword args that follows. This API helps to generate full user accessibility to Projects on Jira. It checks the users access and commits the finding to a report file.
You can tweak the permission argument with the options mention here https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-user-search
for endpoint /rest/api/3/user/permission/search
- Parameters
args (Any) – A set of parameter arguments to supply
project_folder (str) – A folder
project_file_name (str) – A file to hold temp data
user_extraction_file (str) – A file to hold user temp data
permission (str) – A permission of Jira to check
kwargs – Additional arguments
- Returns
None
- Return type
None
USER¶
This is an alias to the
Usersclass of thereportingmodule. It contains methods that are used to easily get user details.
from jiraone import LOGIN, USER
# previous login statement
USER.get_all_users(file="user.csv", folder="USERS")
- class jiraone.reporting.Users¶
This class helps to Generate the No of Users on Jira Cloud
You can customize it to determine which user you’re looking for.
It’s method such as get_all_users displays active or inactive users, so you’ll be getting all users
- get_all_users(pull='both', user_type='atlassian', file=None, folder=typing.Any, **kwargs)¶
Generates a list of users.
- param pull
(options) * both: pulls out inactive and active users * active: pulls out only active users * inactive: pulls out inactive users
- Parameters
user_type (str) – (options) * atlassian: a normal Jira Cloud user * customer: this will be your JSM customers * app: this will be the bot users for any Cloud App * unknown: as the name suggest unknown user type probably from oAuth
file (Optional[str]) – String of the filename
folder (str) – String of the folder name
kwargs –
Additional keyword argument for the method.
- return
Any
pull (str) –
- Return type
Any
- get_all_users_group(group_folder='Groups', group_file_name='group_file.csv', user_extraction_file='group_extraction.csv', **kwargs)¶
Get all users and the groups associated to them on the Instance. :return: None
- Parameters
group_folder (str) –
group_file_name (str) –
user_extraction_file (str) –
- Return type
None
- mention_user(name)¶
Return a format that you can use to mention users on cloud. :param name: The name of a user.
- Returns
List[str]
- Return type
List[str]
- report(category=typing.Any, filename='users_report.csv', **kwargs)¶
Creates a user report file in CSV format. :return: None
- Parameters
category (str) –
filename (str) –
- Return type
None
- search_user(find_user=None, folder='Users', **kwargs)¶
Get a list of all cloud users and search for them by using the displayName.
- Parameters
find_user (Optional[Any]) –
folder (str) –
- Return type
collections.deque
- user_activity(status=typing.Any, account_type=typing.Any, results=typing.Any)¶
Determines users activity.
- Returns
None
- Parameters
status (str) –
account_type (str) –
results (List) –
- Return type
Any
Module¶
The module module contains functions that are specific towards certain task. Each function is designed to be as straightforward
as possible, so you can easily make calls to Jira’s endpoint and get the required data.
from jiraone import LOGIN, USER, echo, field
from jiraone.module import field_update
import json
# a configuration file which is a dict containing keys user, password and url
config = json.load(open('config.json'))
LOGIN(**config)
key = 'ITSM-4'
name = 'Last Update User' # A single user picker field
if __name__ == "__main__":
change = USER.search_user('Prince Nyeche')[0].get('accountId')
make = field_update(field, key, name, data=change)
echo(make)
# output
# <Response [204]>
- jiraone.module.field_update()¶
- jiraone.module.time_in_status(var, key_or_id, reader=None, report_file='time_status.csv', report_folder='TimeStatus', output_format=None, status=None, **kwargs)¶
Return a difference in time between two status or multiple statuses. across different sets of issues. Display the output or send the output into a file either in CSV or JSON.
- Parameters
var (Any) – Alias to the
PROJECTwhich can invoke thechange_log()methodkey_or_id (Union[str, int, List[Union[str, int]], dict]) – An issue key or id or keys put in a list to derive multiples values or use a jql format in dictionary
reader (Optional[Callable]) –
file_readerfunction needs to be passed herereport_file (Optional[str]) – A string of the name of the file
report_folder (Optional[str]) – A folder where data resides
output_format (Optional[str]) – An output format either in CSV or JSON. e.g csv or json (case insensitive)
status (Optional[str]) – A status name to check or output.
kwargs (Any) –
Additional keyword arguments to use
Available options
login - Required keyword argument to authenticate request
pprint -Bool, Optional -formats the datetime output into a nice pretty format.
is_printable - Bool, prints output to terminal if true
- Returns
A Printable representation of the data or output files.
- jiraone.module.bulk_change_email(data, token)¶
Bulk change managed user’s email address if they do not exist.
- Parameters
data (str) – A string of the file name
token (str) – A string of the API token to authenticate the request
- Return type
None
Additionally, the output of failed attempts it written back to your data file.
- Returns
None
- Parameters
data (str) –
token (str) –
- Return type
None
- jiraone.module.bulk_change_swap_email(data, token, **kwargs)¶
The function helps to swap an email address to another.
If the target email exist as an Atlassian account email, this will help to swap that email address to the desired target email.
:param data A string of the file name
:param token An API token to authenticate the API.
:param kwargs Additional keyword argument to pass
Valid values > dummy - A dummy email address to choose if not a default is formed
from your email address
- > users - The name of a file to check the users and their account_id
only needed if you want to search a predefined set of users.
- Returns
None
- Parameters
data (str) –
token (str) –
kwargs (Any) –
- Return type
None