INSTRUCTION
stringlengths
1
46.3k
RESPONSE
stringlengths
75
80.2k
Get page by ID :param page_id: Content ID :param expand: OPTIONAL: expand e.g. history :return:
def get_page_by_id(self, page_id, expand=None): """ Get page by ID :param page_id: Content ID :param expand: OPTIONAL: expand e.g. history :return: """ url = 'rest/api/content/{page_id}?expand={expand}'.format(page_id=page_id, expand=expand) return self.ge...
Returns the list of labels on a piece of Content. :param page_id: A string containing the id of the labels content container. :param prefix: OPTIONAL: The prefixes to filter the labels with {@see Label.Prefix}. Default: None. :param start: OPTIONAL: The start poin...
def get_page_labels(self, page_id, prefix=None, start=None, limit=None): """ Returns the list of labels on a piece of Content. :param page_id: A string containing the id of the labels content container. :param prefix: OPTIONAL: The prefixes to filter the labels with {@see Label.Prefix}. ...
Provide content by id with status = draft :param page_id: :param status: :return:
def get_draft_page_by_id(self, page_id, status='draft'): """ Provide content by id with status = draft :param page_id: :param status: :return: """ url = 'rest/api/content/{page_id}?status={status}'.format(page_id=page_id, status=status) return self.get(url...
Get all page by label :param label: :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by fixed system limits. Default: 50 :return:
def get_all_pages_by_label(self, label, start=0, limit=50): """ Get all page by label :param label: :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted b...
Get all pages from space :param space: :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by fixed system limits. Default: 50 :param...
def get_all_pages_from_space(self, space, start=0, limit=500, status=None): """ Get all pages from space :param space: :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of pages to return, this ...
Get list of pages from trash :param space: :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by fixed system limits. Default: 500 :...
def get_all_pages_from_space_trash(self, space, start=0, limit=500, status='trashed'): """ Get list of pages from trash :param space: :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of pages t...
Get list of draft pages from space Use case is cleanup old drafts from Confluence :param space: :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by ...
def get_all_draft_pages_from_space(self, space, start=0, limit=500, status='draft'): """ Get list of draft pages from space Use case is cleanup old drafts from Confluence :param space: :param start: OPTIONAL: The start point of the collection to return. Default: None (0). ...
Search list of draft pages by space key Use case is cleanup old drafts from Confluence :param space: Space Key :param status: Can be changed :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of ...
def get_all_draft_pages_from_space_through_cql(self, space, start=0, limit=500, status='draft'): """ Search list of draft pages by space key Use case is cleanup old drafts from Confluence :param space: Space Key :param status: Can be changed :param start: OPTIONAL: The st...
This method removes a page, if it has recursive flag, method removes including child pages :param page_id: :param status: OPTIONAL: type of page :param recursive: OPTIONAL: if True - will recursively delete all children pages too :return:
def remove_page(self, page_id, status=None, recursive=False): """ This method removes a page, if it has recursive flag, method removes including child pages :param page_id: :param status: OPTIONAL: type of page :param recursive: OPTIONAL: if True - will recursively delete all chi...
Create page from scratch :param space: :param title: :param body: :param parent_id: :param type: :return:
def create_page(self, space, title, body, parent_id=None, type='page'): """ Create page from scratch :param space: :param title: :param body: :param parent_id: :param type: :return: """ log.info('Creating {type} "{space}" -> "{title}"'.form...
Get all spaces with provided limit :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by fixed system limits. Default: 500
def get_all_spaces(self, start=0, limit=500): """ Get all spaces with provided limit :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by ...
Add comment into page :param page_id :param text
def add_comment(self, page_id, text): """ Add comment into page :param page_id :param text """ data = {'type': 'comment', 'container': {'id': page_id, 'type': 'page', 'status': 'current'}, 'body': {'storage': {'value': text, 'representation...
Attach (upload) a file to a page, if it exists it will update the automatically version the new file and keep the old one. :param title: The page name :type title: ``str`` :param space: The space name :type space: ``str`` :param page_id: The page id to which we would li...
def attach_file(self, filename, page_id=None, title=None, space=None, comment=None): """ Attach (upload) a file to a page, if it exists it will update the automatically version the new file and keep the old one. :param title: The page name :type title: ``str`` :param spa...
Set a label on the page :param page_id: content_id format :param label: label to add :return:
def set_page_label(self, page_id, label): """ Set a label on the page :param page_id: content_id format :param label: label to add :return: """ url = 'rest/api/content/{page_id}/label'.format(page_id=page_id) data = {'prefix': 'global', 'na...
Remove content history. It works as experimental method :param page_id: :param version_number: version number :return:
def remove_content_history(self, page_id, version_number): """ Remove content history. It works as experimental method :param page_id: :param version_number: version number :return: """ url = 'rest/experimental/content/{id}/version/{versionNumber}'.format(id=page_...
Remove content history. It works in CLOUD :param page_id: :param version_id: :return:
def remove_content_history_in_cloud(self, page_id, version_id): """ Remove content history. It works in CLOUD :param page_id: :param version_id: :return: """ url = 'rest/api/content/{id}/version/{versionId}'.format(id=page_id, versionId=version_id) self.de...
Check has unknown attachment error on page :param page_id: :return:
def has_unknown_attachment_error(self, page_id): """ Check has unknown attachment error on page :param page_id: :return: """ unknown_attachment_identifier = 'plugins/servlet/confluence/placeholder/unknown-attachment' result = self.get_page_by_id(page_id, expand='b...
Compare content and check is already updated or not :param page_id: Content ID for retrieve storage value :param body: Body for compare it :return: True if the same
def is_page_content_is_already_updated(self, page_id, body): """ Compare content and check is already updated or not :param page_id: Content ID for retrieve storage value :param body: Body for compare it :return: True if the same """ confluence_content = (self.get...
Update page if already exist :param parent_id: :param page_id: :param title: :param body: :param type: :param minor_edit: Indicates whether to notify watchers about changes. If False then notifications will be sent. :return:
def update_page(self, parent_id, page_id, title, body, type='page', minor_edit=False): """ Update page if already exist :param parent_id: :param page_id: :param title: :param body: :param type: :param minor_edit: Indicates whether to no...
Update page or create a page if it is not exists :param parent_id: :param title: :param body: :return:
def update_or_create(self, parent_id, title, body): """ Update page or create a page if it is not exists :param parent_id: :param title: :param body: :return: """ space = self.get_page_space(parent_id) if self.page_exists(space, title): ...
Set the page (content) property e.g. add hash parameters :param page_id: content_id format :param data: data should be as json data :return:
def set_page_property(self, page_id, data): """ Set the page (content) property e.g. add hash parameters :param page_id: content_id format :param data: data should be as json data :return: """ url = 'rest/api/content/{page_id}/property'.format(page_id=page_id) ...
Delete the page (content) property e.g. delete key of hash :param page_id: content_id format :param page_property: key of property :return:
def delete_page_property(self, page_id, page_property): """ Delete the page (content) property e.g. delete key of hash :param page_id: content_id format :param page_property: key of property :return: """ url = 'rest/api/content/{page_id}/property/{page_property}'....
Get the page (content) property e.g. get key of hash :param page_id: content_id format :param page_property_key: key of property :return:
def get_page_property(self, page_id, page_property_key): """ Get the page (content) property e.g. get key of hash :param page_id: content_id format :param page_property_key: key of property :return: """ url = 'rest/api/content/{page_id}/property/{key}'.format(page...
Get the page (content) properties :param page_id: content_id format :return: get properties
def get_page_properties(self, page_id): """ Get the page (content) properties :param page_id: content_id format :return: get properties """ url = 'rest/api/content/{page_id}/property'.format(page_id=page_id) return self.get(path=url)
Provide the ancestors from the page (content) id :param page_id: content_id format :return: get properties
def get_page_ancestors(self, page_id): """ Provide the ancestors from the page (content) id :param page_id: content_id format :return: get properties """ url = 'rest/api/content/{page_id}?expand=ancestors'.format(page_id=page_id) return (self.get(path=url) or {})....
Clean caches from cache management e.g. com.gliffy.cache.gon org.hibernate.cache.internal.StandardQueryCache_v5
def clean_package_cache(self, cache_name='com.gliffy.cache.gon'): """ Clean caches from cache management e.g. com.gliffy.cache.gon org.hibernate.cache.internal.StandardQueryCache_v5 """ headers = self.form_token_headers data = {'cacheName': cache_name}...
Get all groups from Confluence User management :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by fixed system limits. Default: 1000 ...
def get_all_groups(self, start=0, limit=1000): """ Get all groups from Confluence User management :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by ...
Get a paginated collection of users in the given group :param group_name :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by fixed system ...
def get_group_members(self, group_name='confluence-users', start=0, limit=1000): """ Get a paginated collection of users in the given group :param group_name :param start: OPTIONAL: The start point of the collection to return. Default: None (0). :param limit: OPTIONAL: The limit ...
Get information about a space through space key :param space_key: The unique space key name :param expand: OPTIONAL: additional info from description, homepage :return: Returns the space along with its ID
def get_space(self, space_key, expand='description.plain,homepage'): """ Get information about a space through space key :param space_key: The unique space key name :param expand: OPTIONAL: additional info from description, homepage :return: Returns the space along with its ID ...
Get information about a user through username :param username: The user name :param expand: OPTIONAL expand for get status of user. Possible param is "status". Results are "Active, Deactivated" :return: Returns the user details
def get_user_details_by_username(self, username, expand=None): """ Get information about a user through username :param username: The user name :param expand: OPTIONAL expand for get status of user. Possible param is "status". Results are "Active, Deactivated" :re...
Get information about a user through user key :param userkey: The user key :param expand: OPTIONAL expand for get status of user. Possible param is "status". Results are "Active, Deactivated" :return: Returns the user details
def get_user_details_by_userkey(self, userkey, expand=None): """ Get information about a user through user key :param userkey: The user key :param expand: OPTIONAL expand for get status of user. Possible param is "status". Results are "Active, Deactivated" :return...
Get results from cql search result with all related fields Search for entities in Confluence using the Confluence Query Language (CQL) :param cql: :param start: OPTIONAL: The start point of the collection to return. Default: 0. :param limit: OPTIONAL: The limit of the number of issues to...
def cql(self, cql, start=0, limit=None, expand=None, include_archived_spaces=None, excerpt=None): """ Get results from cql search result with all related fields Search for entities in Confluence using the Confluence Query Language (CQL) :param cql: :param start: OPTIONAL: The sta...
Export page as standard pdf exporter :param page_id: Page ID :return: PDF File
def get_page_as_pdf(self, page_id): """ Export page as standard pdf exporter :param page_id: Page ID :return: PDF File """ headers = self.form_token_headers url = 'spaces/flyingpdf/pdfpageexport.action?pageId={pageId}'.format(pageId=page_id) return self.ge...
Provide space, parent_id and title of the descendant page, it will return the descendant page_id :param space: str :param parent_id: int :param title: str :return: page_id of the page whose title is passed in argument
def get_descendant_page_id(self, space, parent_id, title): """ Provide space, parent_id and title of the descendant page, it will return the descendant page_id :param space: str :param parent_id: int :param title: str :return: page_id of the page whose title is passed in...
Get health status https://confluence.atlassian.com/jirakb/how-to-retrieve-health-check-results-using-rest-api-867195158.html :return:
def health_check(self): """ Get health status https://confluence.atlassian.com/jirakb/how-to-retrieve-health-check-results-using-rest-api-867195158.html :return: """ # check as Troubleshooting & Support Tools Plugin response = self.get('rest/troubleshooting/1.0/ch...
Reindex the Jira instance Kicks off a reindex. Need Admin permissions to perform this reindex. :param comments: Indicates that comments should also be reindexed. Not relevant for foreground reindex, where comments are always reindexed. :param change_history: Indicates that changeHistory ...
def reindex(self, comments=True, change_history=True, worklogs=True): """ Reindex the Jira instance Kicks off a reindex. Need Admin permissions to perform this reindex. :param comments: Indicates that comments should also be reindexed. Not relevant for foreground reindex, where c...
Get issues from jql search result with all related fields :param jql: :param fields: list of fields, for example: ['priority', 'summary', 'customfield_10007'] :param start: OPTIONAL: The start point of the collection to return. Default: 0. :param limit: OPTIONAL: The limit of the number ...
def jql(self, jql, fields='*all', start=0, limit=None): """ Get issues from jql search result with all related fields :param jql: :param fields: list of fields, for example: ['priority', 'summary', 'customfield_10007'] :param start: OPTIONAL: The start point of the collection to ...
Get issues from jql search result with all related fields :param jql: JQL query :param limit: max results in the output file :return: CSV file
def csv(self, jql, limit=1000): """ Get issues from jql search result with all related fields :param jql: JQL query :param limit: max results in the output file :return: CSV file """ url = 'sr/jira.issueviews:searchrequest-csv-all-fields/temp/SearchRequest.csv?tem...
Update user attributes based on json :param username: :param data: :return:
def user_update(self, username, data): """ Update user attributes based on json :param username: :param data: :return: """ url = 'rest/api/2/user?username={0}'.format(username) return self.put(url, data=data)
Update user email for new domain changes :param username: :param email: :return:
def user_update_email(self, username, email): """ Update user email for new domain changes :param username: :param email: :return: """ data = {'name': username, 'emailAddress': email} return self.user_update(username, data=data)
Disable user :param username: :return:
def user_deactivate(self, username): """ Disable user :param username: :return: """ url = 'secure/admin/user/EditUser.jspa' headers = self.form_token_headers user = self.user(username) user_update_info = { 'inline': 'true', ...
The disable method throw own rest enpoint
def user_disable_throw_rest_endpoint(self, username, url='rest/scriptrunner/latest/custom/disableUser', param='userName'): """The disable method throw own rest enpoint""" url = "{}?{}={}".format(url, param, username) return self.get(path=url)
Get web sudo cookies using normal http request
def user_get_websudo(self): """ Get web sudo cookies using normal http request""" url = 'secure/admin/WebSudoAuthenticate.jspa' headers = self.form_token_headers data = { 'webSudoPassword': self.password, } return self.post(path=url, data=data, headers=headers...
Fuzzy search using username and display name :param username: Use '.' to find all users :param start: OPTIONAL: The start point of the collection to return. Default: 0. :param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by fixed system limi...
def user_find_by_user_string(self, username, start=0, limit=50, include_inactive_users=False, include_active_users=True): """ Fuzzy search using username and display name :param username: Use '.' to find all users :param start: OPTIONAL: The start point of the collection to return. Defau...
Contains a full representation of a the specified project's versions. :param key: :param expand: the parameters to expand :return:
def get_project_versions(self, key, expand=None): """ Contains a full representation of a the specified project's versions. :param key: :param expand: the parameters to expand :return: """ params = {} if expand is not None: params['expand'] = e...
Returns all versions for the specified project. Results are paginated. Results can be ordered by the following fields: sequence name startDate releaseDate :param key: the project key or id :param start: the page offset, if not specified then defaul...
def get_project_versions_paginated(self, key, start=None, limit=None, order_by=None, expand=None): """ Returns all versions for the specified project. Results are paginated. Results can be ordered by the following fields: sequence name startDate re...
Returns the details for a given project role in a project. :param project_key: :param role_id: :return:
def get_project_actors_for_role_project(self, project_key, role_id): """ Returns the details for a given project role in a project. :param project_key: :param role_id: :return: """ url = 'rest/api/2/project/{projectIdOrKey}/role/{id}'.format(projectIdOrKey=project...
Deletes actors (users or groups) from a project role. Delete a user from the role: /rest/api/2/project/{projectIdOrKey}/role/{roleId}?user={username} Delete a group from the role: /rest/api/2/project/{projectIdOrKey}/role/{roleId}?group={groupname} :param project_key: :param role_id: ...
def delete_project_actors(self, project_key, role_id, actor, actor_type=None): """ Deletes actors (users or groups) from a project role. Delete a user from the role: /rest/api/2/project/{projectIdOrKey}/role/{roleId}?user={username} Delete a group from the role: /rest/api/2/project/{proj...
Get custom fields. Evaluated on 7.12 :param search: str :param start: long Default: 1 :param limit: int Default: 50 :return:
def get_custom_fields(self, search=None, start=1, limit=50): """ Get custom fields. Evaluated on 7.12 :param search: str :param start: long Default: 1 :param limit: int Default: 50 :return: """ url = 'rest/api/2/customFields' params = {} if...
Get issue labels. :param issue_key: :return:
def get_issue_labels(self, issue_key): """ Get issue labels. :param issue_key: :return: """ url = 'rest/api/2/issue/{issue_key}?fields=labels'.format(issue_key=issue_key) return (self.get(url) or {}).get('fields').get('labels')
Provide assignable users for project :param project_key: :param start: OPTIONAL: The start point of the collection to return. Default: 0. :param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by fixed system limits. Default by built-in method:...
def get_all_assignable_users_for_project(self, project_key, start=0, limit=50): """ Provide assignable users for project :param project_key: :param start: OPTIONAL: The start point of the collection to return. Default: 0. :param limit: OPTIONAL: The limit of the number of users t...
REST endpoint for searching groups in a group picker Returns groups with substrings matching a given query. This is mainly for use with the group picker, so the returned groups contain html to be used as picker suggestions. The groups are also wrapped in a single response object that also contai...
def get_groups(self, query=None, exclude=None, limit=20): """ REST endpoint for searching groups in a group picker Returns groups with substrings matching a given query. This is mainly for use with the group picker, so the returned groups contain html to be used as picker suggestions. Th...
Create a group by given group parameter :param name: str :return: New group params
def create_group(self, name): """ Create a group by given group parameter :param name: str :return: New group params """ url = 'rest/api/2/group' data = {'name': name} return self.post(url, data=data)
Delete a group by given group parameter If you delete a group and content is restricted to that group, the content will be hidden from all users To prevent this, use this parameter to specify a different group to transfer the restrictions (comments and worklogs only) to :param name: str...
def remove_group(self, name, swap_group=None): """ Delete a group by given group parameter If you delete a group and content is restricted to that group, the content will be hidden from all users To prevent this, use this parameter to specify a different group to transfer the restriction...
Just wrapping method user group members :param group: :param include_inactive_users: :param start: OPTIONAL: The start point of the collection to return. Default: 0. :param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by fixed system...
def get_all_users_from_group(self, group, include_inactive_users=False, start=0, limit=50): """ Just wrapping method user group members :param group: :param include_inactive_users: :param start: OPTIONAL: The start point of the collection to return. Default: 0. :param lim...
Add given user to a group :param username: str :param group_name: str :return: Current state of the group
def add_user_to_group(self, username, group_name): """ Add given user to a group :param username: str :param group_name: str :return: Current state of the group """ url = 'rest/api/2/group/user' params = {'groupname': group_name} data = {'name': u...
Remove given user from a group :param username: str :param group_name: str :return:
def remove_user_from_group(self, username, group_name): """ Remove given user from a group :param username: str :param group_name: str :return: """ log.warning('Removing user from a group...') url = 'rest/api/2/group/user' params = {'groupname': g...
Add comment into Jira issue :param issue_key: :param comment: :param visibility: OPTIONAL :return:
def issue_add_comment(self, issue_key, comment, visibility=None): """ Add comment into Jira issue :param issue_key: :param comment: :param visibility: OPTIONAL :return: """ url = 'rest/api/2/issue/{issueIdOrKey}/comment'.format(issueIdOrKey=issue_key) ...
Add attachment to Issue :param issue_key: str :param filename: str, name, if file in current directory or full path to file
def add_attachment(self, issue_key, filename): """ Add attachment to Issue :param issue_key: str :param filename: str, name, if file in current directory or full path to file """ log.warning('Adding attachment...') headers = {'X-Atlassian-Token': 'no-check'} ...
Compatibility naming method with get_issue_remote_links()
def get_issue_remotelinks(self, issue_key, global_id=None, internal_id=None): """ Compatibility naming method with get_issue_remote_links() """ return self.get_issue_remote_links(issue_key, global_id, internal_id)
Finding all Remote Links on an issue, also with filtering by Global ID and internal ID :param issue_key: :param global_id: str :param internal_id: str :return:
def get_issue_remote_links(self, issue_key, global_id=None, internal_id=None): """ Finding all Remote Links on an issue, also with filtering by Global ID and internal ID :param issue_key: :param global_id: str :param internal_id: str :return: """ url = 're...
Add Remote Link to Issue, update url if global_id is passed :param issue_key: str :param link_url: str :param title: str :param global_id: str, OPTIONAL: :param relationship: str, OPTIONAL: Default by built-in method: 'Web Link'
def create_or_update_issue_remote_links(self, issue_key, link_url, title, global_id=None, relationship=None): """ Add Remote Link to Issue, update url if global_id is passed :param issue_key: str :param link_url: str :param title: str :param global_id: str, OPTIONAL: ...
Update existing Remote Link on Issue :param issue_key: str :param link_id: str :param url: str :param title: str :param global_id: str, OPTIONAL: :param relationship: str, Optional. Default by built-in method: 'Web Link'
def update_issue_remote_link_by_id(self, issue_key, link_id, url, title, global_id=None, relationship=None): """ Update existing Remote Link on Issue :param issue_key: str :param link_id: str :param url: str :param title: str :param global_id: str, OPTIONAL: ...
Deletes Remote Link on Issue :param issue_key: str :param link_id: str
def delete_issue_remote_link_by_id(self, issue_key, link_id): """ Deletes Remote Link on Issue :param issue_key: str :param link_id: str """ url = 'rest/api/2/issue/{issue_key}/remotelink/{link_id}'.format(issue_key=issue_key, link_id=link_id) return self.delete(u...
Create a new issue link type. :param outward: :param inward: :param link_type_name: :return:
def create_issue_link_type(self, link_type_name, inward, outward): """Create a new issue link type. :param outward: :param inward: :param link_type_name: :return: """ if link_type_name.lower() in [x.lower() for x in self.get_issue_link_types_names()]: ...
Returns for a given issue link type id all information about this issue link type.
def get_issue_link_type(self, issue_link_type_id): """Returns for a given issue link type id all information about this issue link type. """ url = 'rest/api/2/issueLinkType/{issueLinkTypeId}'.format(issueLinkTypeId=issue_link_type_id) return self.get(url)
Delete the specified issue link type.
def delete_issue_link_type(self, issue_link_type_id): """Delete the specified issue link type.""" url = 'rest/api/2/issueLinkType/{issueLinkTypeId}'.format(issueLinkTypeId=issue_link_type_id) return self.delete(url)
Update the specified issue link type. :param issue_link_type_id: :param data: { "name": "Duplicate", "inward": "Duplicated by", "outward": "Duplicates" } :return:
def update_issue_link_type(self, issue_link_type_id, data): """ Update the specified issue link type. :param issue_link_type_id: :param data: { "name": "Duplicate", "inward": "Duplicated by", "outward": "Duplicat...
Returns counts of issues related to this component. :param component_id: :return:
def get_component_related_issues(self, component_id): """ Returns counts of issues related to this component. :param component_id: :return: """ url = 'rest/api/2/component/{component_id}/relatedIssueCounts'.format(component_id=component_id) return self.get(url)
Provide plugin path for upload into Jira e.g. useful for auto deploy :param plugin_path: :return:
def upload_plugin(self, plugin_path): """ Provide plugin path for upload into Jira e.g. useful for auto deploy :param plugin_path: :return: """ files = { 'plugin': open(plugin_path, 'rb') } headers = { 'X-Atlassian-Token': 'nocheck'...
Returns a list of all permission schemes. By default only shortened beans are returned. If you want to include permissions of all the schemes, then specify the permissions expand parameter. Permissions will be included also if you specify any other expand parameter. :param expand...
def get_all_permissionschemes(self, expand=None): """ Returns a list of all permission schemes. By default only shortened beans are returned. If you want to include permissions of all the schemes, then specify the permissions expand parameter. Permissions will be included...
Returns a list of all permission schemes. By default only shortened beans are returned. If you want to include permissions of all the schemes, then specify the permissions expand parameter. Permissions will be included also if you specify any other expand parameter. :param permis...
def get_permissionscheme(self, permission_id, expand=None): """ Returns a list of all permission schemes. By default only shortened beans are returned. If you want to include permissions of all the schemes, then specify the permissions expand parameter. Permissions will b...
Creates a permission grant in a permission scheme. Example: { "holder": { "type": "group", "parameter": "jira-developers" }, "permission": "ADMINISTER_PROJECTS" } :param permission_id :param new_permission ...
def set_permissionscheme_grant(self, permission_id, new_permission): """ Creates a permission grant in a permission scheme. Example: { "holder": { "type": "group", "parameter": "jira-developers" }, "permission": "ADMINI...
Get all Accounts that the logged in user has permission to browse. :param skip_archived: bool OPTIONAL: skip archived Accounts, either true or false, default value true. :param expand: bool OPTIONAL: With expanded data or not :return:
def tempo_account_get_accounts(self, skip_archived=None, expand=None): """ Get all Accounts that the logged in user has permission to browse. :param skip_archived: bool OPTIONAL: skip archived Accounts, either true or false, default value true. :param expand: bool OPTIONAL: With expanded...
The AccountLinkBean for associate Account with project Adds a link to an Account. { scopeType:PROJECT defaultAccount:boolean linkType:IMPORTED | MANUAL name:string key:string accountId:number scope:number id:...
def tempo_account_associate_with_jira_project(self, account_id, project_id, default_account=False, link_type='MANUAL'): """ The AccountLinkBean for associate Account with project Adds a link to an...
Creates Account, adding new Account requires the Manage Accounts Permission. :param data: String then it will convert to json :return:
def tempo_account_add_account(self, data=None): """ Creates Account, adding new Account requires the Manage Accounts Permission. :param data: String then it will convert to json :return: """ url = 'rest/tempo-accounts/1/account/' if data is None: retur...
Delete an Account by id. Caller must have the Manage Account Permission for the Account. The Account can not be deleted if it has an AccountLinkBean. :param account_id: the id of the Account to be deleted. :return:
def tempo_account_delete_account_by_id(self, account_id): """ Delete an Account by id. Caller must have the Manage Account Permission for the Account. The Account can not be deleted if it has an AccountLinkBean. :param account_id: the id of the Account to be deleted. :return: ...
Get un-archived Accounts by customer. The Caller must have the Browse Account permission for the Account. :param customer_id: the Customer id. :return:
def tempo_account_get_all_account_by_customer_id(self, customer_id): """ Get un-archived Accounts by customer. The Caller must have the Browse Account permission for the Account. :param customer_id: the Customer id. :return: """ url = 'rest/tempo-accounts/1/account/custom...
Gets all or some Attribute whose key or name contain a specific substring. Attributes can be a Category or Customer. :param query: OPTIONAL: query for search :param count_accounts: bool OPTIONAL: provide how many associated Accounts with Customer :return: list of customers
def tempo_account_get_customers(self, query=None, count_accounts=None): """ Gets all or some Attribute whose key or name contain a specific substring. Attributes can be a Category or Customer. :param query: OPTIONAL: query for search :param count_accounts: bool OPTIONAL: provide ...
Gets all or some Attribute whose key or name contain a specific substring. Attributes can be a Category or Customer. :param data: :return: if error will show in error log, like validation unsuccessful. If success will good.
def tempo_account_add_customer(self, data=None): """ Gets all or some Attribute whose key or name contain a specific substring. Attributes can be a Category or Customer. :param data: :return: if error will show in error log, like validation unsuccessful. If success will good. ...
Get Account Attribute whose key or name contain a specific substring. Attribute can be a Category or Customer. :param customer_id: id of Customer record :return: Customer info
def tempo_account_get_customer_by_id(self, customer_id=1): """ Get Account Attribute whose key or name contain a specific substring. Attribute can be a Category or Customer. :param customer_id: id of Customer record :return: Customer info """ url = 'rest/tempo-accounts/1/...
Updates an Attribute. Caller must have Manage Account Permission. Attribute can be a Category or Customer. :param customer_id: id of Customer record :param data: format is { isNew:boolean name:string key:string ...
def tempo_account_update_customer_by_id(self, customer_id=1, data=None): """ Updates an Attribute. Caller must have Manage Account Permission. Attribute can be a Category or Customer. :param customer_id: id of Customer record :param data: format is { ...
Delete an Attribute. Caller must have Manage Account Permission. Attribute can be a Category or Customer. :param customer_id: id of Customer record :return: Customer info
def tempo_account_delete_customer_by_id(self, customer_id=1): """ Delete an Attribute. Caller must have Manage Account Permission. Attribute can be a Category or Customer. :param customer_id: id of Customer record :return: Customer info """ url = 'rest/tempo-accounts/1/cu...
Get csv export file of Accounts from Tempo :return: csv file
def tempo_account_export_accounts(self): """ Get csv export file of Accounts from Tempo :return: csv file """ headers = self.form_token_headers url = 'rest/tempo-accounts/1/export' return self.get(url, headers=headers, not_json_response=True)
Returns all boards. This only includes boards that the user has permission to view. :param board_name: :param project_key: :param board_type: :param start: :param limit: :return:
def get_all_agile_boards(self, board_name=None, project_key=None, board_type=None, start=0, limit=50): """ Returns all boards. This only includes boards that the user has permission to view. :param board_name: :param project_key: :param board_type: :param start: :...
Get agile board info by id :param board_id: :return:
def get_agile_board(self, board_id): """ Get agile board info by id :param board_id: :return: """ url = 'rest/agile/1.0/board/{}'.format(str(board_id)) return self.get(url)
Get the board configuration. The response contains the following fields: id - Id of the board. name - Name of the board. filter - Reference to the filter used by the given board. subQuery (Kanban only) - JQL subquery used by the given board. columnConfig - The column configuratio...
def get_agile_board_configuration(self, board_id): """ Get the board configuration. The response contains the following fields: id - Id of the board. name - Name of the board. filter - Reference to the filter used by the given board. subQuery (Kanban only) - JQL subquery ...
Delete agile board by id :param board_id: :return:
def delete_agile_board(self, board_id): """ Delete agile board by id :param board_id: :return: """ url = 'rest/agile/1.0/board/{}'.format(str(board_id)) return self.delete(url)
Creating customer user :param full_name: str :param email: str :return: New customer
def create_customer(self, full_name, email): """ Creating customer user :param full_name: str :param email: str :return: New customer """ log.warning('Creating customer...') data = {'fullName': full_name, 'email': email} return self.post('rest/se...
Creating customer request :param service_desk_id: str :param request_type_id: str :param values_dict: str :param raise_on_behalf_of: str :return: New request
def create_customer_request(self, service_desk_id, request_type_id, values_dict, raise_on_behalf_of=None): """ Creating customer request :param service_desk_id: str :param request_type_id: str :param values_dict: str :param raise_on_behalf_of: str :return: New re...
Get customer request status name :param issue_id_or_key: str :return: Status name
def get_customer_request_status(self, issue_id_or_key): """ Get customer request status name :param issue_id_or_key: str :return: Status name """ request = self.get('rest/servicedeskapi/request/{}/status'.format(issue_id_or_key)).get('values') status = request[0]...
Returns a list of transitions that customers can perform on the request :param issue_id_or_key: str :return:
def get_customer_transitions(self, issue_id_or_key): """ Returns a list of transitions that customers can perform on the request :param issue_id_or_key: str :return: """ url = 'rest/servicedeskapi/request/{}/transition'.format(issue_id_or_key) return self.get(ur...
Get request participants :param issue_id_or_key: str :param start: OPTIONAL: int :param limit: OPTIONAL: int :return: Request participants
def get_request_participants(self, issue_id_or_key, start=0, limit=50): """ Get request participants :param issue_id_or_key: str :param start: OPTIONAL: int :param limit: OPTIONAL: int :return: Request participants """ url = 'rest/servicedeskapi/request/{...
Add users as participants to an existing customer request The calling user must have permission to manage participants for this customer request :param issue_id_or_key: str :param users_list: list :return:
def add_request_participants(self, issue_id_or_key, users_list): """ Add users as participants to an existing customer request The calling user must have permission to manage participants for this customer request :param issue_id_or_key: str :param users_list: list :retu...
Remove participants from an existing customer request The calling user must have permission to manage participants for this customer request :param issue_id_or_key: str :param users_list: list :return:
def remove_request_participants(self, issue_id_or_key, users_list): """ Remove participants from an existing customer request The calling user must have permission to manage participants for this customer request :param issue_id_or_key: str :param users_list: list :retur...
Perform a customer transition for a given request and transition ID. An optional comment can be included to provide a reason for the transition. :param issue_id_or_key: str :param transition_id: str :param comment: OPTIONAL: str :return: None
def perform_transition(self, issue_id_or_key, transition_id, comment=None): """ Perform a customer transition for a given request and transition ID. An optional comment can be included to provide a reason for the transition. :param issue_id_or_key: str :param transition_id: str ...
Creating request comment :param issue_id_or_key: str :param body: str :param public: OPTIONAL: bool (default is True) :return: New comment
def create_request_comment(self, issue_id_or_key, body, public=True): """ Creating request comment :param issue_id_or_key: str :param body: str :param public: OPTIONAL: bool (default is True) :return: New comment """ log.warning('Creating comment...') ...
Returns a list of organizations in the Jira instance. If the user is not an agent, the resource returns a list of organizations the user is a member of. :param service_desk_id: OPTIONAL: str Get organizations from single Service Desk :param start: OPTIONAL: int The starting index of the returne...
def get_organisations(self, service_desk_id=None, start=0, limit=50): """ Returns a list of organizations in the Jira instance. If the user is not an agent, the resource returns a list of organizations the user is a member of. :param service_desk_id: OPTIONAL: str Get organizations from...
Get all the users of a specified organization :param organization_id: str :param start: OPTIONAL: int :param limit: OPTIONAL: int :return: Users list in organization
def get_users_in_organization(self, organization_id, start=0, limit=50): """ Get all the users of a specified organization :param organization_id: str :param start: OPTIONAL: int :param limit: OPTIONAL: int :return: Users list in organization """ url = 'r...
Get an organization for a given organization ID :param organization_id: str :return: Organization
def get_organization(self, organization_id): """ Get an organization for a given organization ID :param organization_id: str :return: Organization """ url = 'rest/servicedeskapi/organization/{}'.format(organization_id) return self.get(url, headers=self.experimen...