class JIRA: (source)
User interface to Jira. Clients interact with Jira by constructing an instance of this object and calling its methods. For addressable resources in Jira -- those with "self" links -- an appropriate subclass of :py:class:`jira.resources.Resource` will be returned with customized ``update()`` and ``delete()`` methods, along with attribute access to fields. This means that calls of the form ``issue.fields.summary`` will be resolved into the proper lookups to return the JSON value at that mapping. Methods that do not return resources will return a dict constructed from the JSON response or a scalar value; see each method's documentation for details on what that method returns. Without any arguments, this client will connect anonymously to the Jira instance started by the Atlassian Plugin SDK from one of the 'atlas-run', ``atlas-debug`` or ``atlas-run-standalone`` commands. By default, this instance runs at ``http://localhost:2990/jira``. The ``options`` argument can be used to set the Jira instance to use. Authentication is handled with the ``basic_auth`` argument. If authentication is supplied (and is accepted by Jira), the client will remember it for subsequent requests. For quick command line access to a server, see the ``jirashell`` script included with this distribution. The easiest way to instantiate is using ``j = JIRA("https://jira.atlassian.com")``
Method | __del__ |
Destructor for JIRA instance. |
Method | __init__ |
Construct a Jira client instance. |
Method | add |
Attach an attachment to an issue and returns a Resource for it. |
Method | add |
Add a comment from the current authenticated user on the specified issue and return a Resource for it. |
Method | add |
Create a new group in Jira. |
Method | add |
Add or update a specific issue property Resource. |
Method | add |
Add the issues in ``issue_keys`` to the ``epic_id``. |
Method | add |
Add the issues in ``issue_keys`` to the ``sprint_id``. |
Method | add |
Add a remote link from an issue to an external application and returns a remote link Resource for it. |
Method | add |
Add a simple remote link from an issue to web resource. |
Method | add |
Create a new Jira user. |
Method | add |
Add a user to an existing group. |
Method | add |
Register a vote for the current authenticated user on an issue. |
Method | add |
Add a user to an issue's watchers list. |
Method | add |
Add a new worklog entry on an issue and return a Resource for it. |
Method | application |
Return the mutable server application properties. |
Method | applicationlinks |
List of application links. |
Method | assign |
Assign an issue to a user. |
Method | async |
Execute all asynchronous jobs and wait for them to finish. By default it will run on 10 threads. |
Method | attachment |
Get an attachment Resource from the server for the specified ID. |
Method | attachment |
Get the attachment metadata. |
Method | avatars |
Undocumented |
Method | backup |
Will call jira export to backup as zipped xml. Returning with success does not mean that the backup process finished. |
Method | backup |
Return boolean based on 'alternativePercentage' and 'size' returned from backup_progress (cloud only). |
Method | backup |
Download backup file from WebDAV (cloud only). |
Method | backup |
Return status of cloud backup as a dict. |
Method | boards |
Get a list of board resources. |
Method | client |
Get the server this client is connected to. |
Method | close |
Undocumented |
Method | comment |
Get a comment Resource from the server for the specified ID. |
Method | comments |
Get a list of comment Resources of the issue provided. |
Method | component |
Get a component Resource from the server. |
Method | component |
Get the count of related issues for a component. |
Method | confirm |
Confirm the temporary avatar image previously uploaded with the specified cropping. |
Method | confirm |
Confirm the temporary avatar image previously uploaded with the specified cropping. |
Method | create |
Create a new board for the ``project_ids``. |
Method | create |
Create a component inside a project and return a Resource for it. |
Method | create |
Create a new customer and return an issue Resource for it. |
Method | create |
Create a new customer request and return an issue Resource for it. |
Method | create |
Create a new filter and return a filter Resource for it. |
Method | create |
Create a new issue and return an issue Resource for it. |
Method | create |
Create a link between two issues. |
Method | create |
Bulk create new issues and return an issue Resource for each successfully created issue. |
Method | create |
Create a project with the specified parameters. |
Method | create |
Create a new sprint for the ``board_id``. |
Method | create |
Register an image file as a project avatar. |
Method | create |
Register an image file as a user avatar. |
Method | create |
Create a version in a project and return a Resource for it. |
Method | createmeta |
Get the metadata required to create issues, optionally filtered by projects and issue types. |
Method | createmeta |
Get the field metadata for a given project and issue type, required to create issues. |
Method | createmeta |
Get the issue types metadata for a given project, required to create issues. |
Method | current |
Return the `accountId` (Cloud) else `username` of the current user. |
Method | custom |
Get a custom field option Resource from the server. |
Method | dashboard |
Get a dashboard Resource from the server. |
Method | dashboards |
Return a ResultList of Dashboard resources and a ``total`` count. |
Method | deactivate |
Disable/deactivate the user. |
Method | delete |
Delete attachment by id. |
Method | delete |
Delete an agile board. |
Method | delete |
Delete component by id. |
Method | delete |
Delete a link between two issues. |
Method | delete |
Undocumented |
Method | delete |
Delete project from Jira. |
Method | delete |
Delete a project's avatar. |
Method | delete |
Delete remote link from issue by internalId or globalId. |
Method | delete |
Undocumented |
Method | delete |
Deletes a Jira User. |
Method | delete |
Delete a user's avatar. |
Method | editmeta |
Get the edit metadata for an issue. |
Method | favourite |
Get a list of filter Resources which are the favourites of the currently authenticated user. |
Method | fields |
Return a list of all issue fields. |
Method | filter |
Get a filter Resource from the server. |
Method | find |
Find Resource object for any addressable resource on the server. |
Method | find |
Get a transitionid available on the specified issue to the current user. |
Method | get |
Undocumented |
Method | get |
For the specified issue type scheme, returns all of the associated projects. (Admin required). |
Method | get |
Get a version Resource by its name present on a project. |
Method | group |
Get a group Resource from the server. |
Method | group |
Return a hash or users with their information. Requires Jira 6.0 or will raise NotImplemented. |
Method | groups |
Return a list of groups matching the specified criteria. |
Method | incompleted |
Return the total incompleted points this sprint. |
Method | issue |
Get an issue Resource from the server. |
Method | issue |
Get an issue link Resource from the server. |
Method | issue |
Get an issue link type Resource from the server. |
Method | issue |
Get a list of issue link type Resources from the server. |
Method | issue |
Get a list of issue property Resource from the server for an issue. |
Method | issue |
Get a specific issue property Resource from the server. |
Method | issue |
Get an issue type Resource from the server. |
Method | issue |
Get issue type by name. |
Method | issue |
Get all issue type schemes defined (Admin required). |
Method | issue |
Get a list of issue type Resources from the server. |
Method | issue |
Get a list of issue types available within the project. |
Method | issuesecurityschemes |
Undocumented |
Method | kill |
Destroy the session of the current authenticated user. |
Method | kill |
Destroy the user's current WebSudo session. |
Method | move |
Move issues in ``issue_keys`` to the backlog, removing them from all sprints that have not been completed. |
Method | move |
Move a version within a project's ordered version list and return a new version Resource for it. |
Method | my |
Get a dict of all available permissions on the server. |
Method | myself |
Get a dict of server information for this Jira instance. |
Method | notificationschemes |
Undocumented |
Method | permissionschemes |
Undocumented |
Method | priorities |
Get a list of priority Resources from the server. |
Method | priority |
Get a priority Resource from the server. |
Method | project |
Get a project Resource from the server. |
Method | project |
Get a dict of all avatars for a project visible to the current authenticated user. |
Method | project |
Get a list of component Resources present on a project. |
Method | project |
Get a IssueSecurityLevelScheme Resource from the server. |
Method | project |
Get a NotificationScheme Resource from the server. |
Method | project |
Get a PermissionScheme Resource from the server. |
Method | project |
Get a PriorityScheme Resource from the server. |
Method | project |
Get a role Resource. |
Method | project |
Get a dict of role names to resource locations for a project. |
Method | project |
Get a list of version Resources present on a project. |
Method | project |
Get a WorkflowScheme Resource from the server. |
Method | projectcategories |
Undocumented |
Method | projects |
Get a list of project Resources from the server visible to the current authenticated user. |
Method | rank |
Rank an issue before/after another using the default Ranking field, the one named 'Rank'. |
Method | reindex |
Start jira re-indexing. Returns True if reindexing is in progress or not needed, or False. |
Method | remote |
Get a remote link Resource from the server. |
Method | remote |
Get a list of remote link Resources from an issue. |
Method | remove |
Delete a group from the Jira instance. |
Method | remove |
Remove a user from a group. |
Method | remove |
Remove the current authenticated user's vote from an issue. |
Method | remove |
Remove a user from an issue's watch list. |
Method | removed |
Return the completed issues for the sprint. |
Method | removed |
Return the total incompleted points this sprint. |
Method | rename |
Rename a Jira user. |
Method | rename |
Rename a version Resource on a project. |
Method | request |
Undocumented |
Method | request |
Returns request types supported by a service desk instance. |
Method | resolution |
Get a resolution Resource from the server. |
Method | resolutions |
Get a list of resolution Resources from the server. |
Method | role |
Return Jira role information. |
Method | screens |
Undocumented |
Method | search |
Get a list of user Resources that match a username string and have browse permission for the issue or project. |
Method | search |
Get a list of user Resources that match the search string for assigning or creating issues. |
Method | search |
Get a list of user Resources that match the search string and can be assigned issues for projects. |
Method | search |
Get a :class:`~jira.client.ResultList` of issue Resources matching a JQL search string. |
Method | search |
Get a list of user Resources that match the specified search string. |
Method | security |
Get a security level Resource. |
Method | server |
Get a dict of server information for this Jira instance. |
Method | service |
Get a Service Desk Resource from the server. |
Method | service |
Get a list of ServiceDesk Resources from the server visible to the current authenticated user. |
Method | session |
Get a dict of the current authenticated user's session information. |
Method | set |
Set the application property. |
Method | set |
Set a project's avatar. |
Method | set |
Set a user's avatar. |
Method | sprint |
Return the information about a sprint. |
Method | sprint |
Return the information about a sprint. |
Method | sprints |
Get a list of sprint Resources. |
Method | sprints |
Get a dictionary of sprint Resources where the name of the sprint is the key. |
Method | status |
Get a status Resource from the server. |
Method | statuscategories |
Get a list of status category Resources from the server. |
Method | statuscategory |
Get a status category Resource from the server. |
Method | statuses |
Get a list of all status Resources from the server. |
Method | supports |
Returns if the Jira instance supports service desk. |
Method | templates |
Undocumented |
Method | transition |
Perform a transition on an issue. |
Method | transitions |
Get a list of the transitions available on the specified issue to the current user. |
Method | update |
Update a filter and return a filter Resource for it. |
Method | update |
Updates the sprint with the given values. |
Method | user |
Get a user Resource from the server. |
Method | user |
Get a dict of avatars for the specified user. |
Method | version |
Get a version Resource. |
Method | version |
Get a dict of the counts of issues fixed and affected by a version. |
Method | version |
Get the number of unresolved issues for a version. |
Method | votes |
Get a votes Resource from the server. |
Method | watchers |
Get a watchers Resource from the server for an issue. |
Method | workflows |
Undocumented |
Method | workflowscheme |
Undocumented |
Method | worklog |
Get a specific worklog Resource from the server. |
Method | worklogs |
Get a list of worklog Resources from the server for an issue. |
Constant | DEFAULT |
Undocumented |
Class Variable | checked |
Undocumented |
Instance Variable | auth |
Undocumented |
Instance Variable | auth |
Undocumented |
Instance Variable | deployment |
Undocumented |
Instance Variable | log |
Undocumented |
Instance Variable | sys |
Undocumented |
Property | server |
Return the server url. |
Static Method | _timestamp |
Undocumented |
Method | _add |
Adds the client certificate to the session. |
Method | _add |
Adds verification strategy for host SSL certificates. |
Method | _check |
Undocumented |
Method | _check |
Check if the current version of the library is outdated. |
Method | _create |
Undocumented |
Method | _create |
Creates a basic http session. |
Method | _create |
Undocumented |
Method | _create |
Undocumented |
Method | _create |
Undocumented |
Method | _create |
Creates token-based session. |
Method | _fetch |
Fetch from a paginated end point. |
Method | _find |
Uses the find method of the provided Resource class. |
Method | _gain |
Undocumented |
Method | _get |
Return the batch size for the given resource type from the options. |
Method | _get |
Undocumented |
Method | _get |
Get the json for a given path and params. |
Method | _get |
Returns the full url based on Jira base url and the path provided. |
Method | _get |
Get the MIME type for a given stream of bytes. |
Method | _get |
Undocumented |
Method | _get |
Returns the full url based on Jira base url and the path provided. |
Method | _get |
Internal method for translating a user search (str) to an id. |
Method | _get |
Get the unique identifier depending on the deployment type. |
Method | _set |
Undocumented |
Method | _try |
Undocumented |
Method | _update |
Update the cache used for `self._fields_cache`. |
Instance Variable | _applicationlinks |
Undocumented |
Instance Variable | _cached |
Undocumented |
Instance Variable | _fields |
Undocumented |
Instance Variable | _myself |
Undocumented |
Instance Variable | _options |
Undocumented |
Instance Variable | _rank |
Undocumented |
Instance Variable | _session |
Undocumented |
Instance Variable | _version |
Undocumented |
Property | _fields |
Cached dictionary of {Field Name: Field ID}. Lazy loaded. |
Property | _is |
Return whether we are on a Cloud based Jira instance. |
str
= None, options: Dict[ str, Union[ str, bool, Any]]
= None, basic_auth: Optional[ Tuple[ str, str]]
= None, token_auth: Optional[ str]
= None, oauth: Dict[ str, Any]
= None, jwt: Dict[ str, Any]
= None, kerberos=False, kerberos_options: Dict[ str, Any]
= None, validate=False, get_server_info: bool
= True, async_: bool
= False, async_workers: int
= 5, logging: bool
= True, max_retries: int
= 3, proxies: Any
= None, timeout: Optional[ Union[ None, float, Tuple[ float, float], Tuple[ float, None]]]
= None, auth: Tuple[ str, str]
= None, default_batch_sizes: Optional[ Dict[ Type[ Resource], Optional[ int]]]
= None):
(source)
¶
Construct a Jira client instance. Without any arguments, this client will connect anonymously to the Jira instance started by the Atlassian Plugin SDK from one of the 'atlas-run', ``atlas-debug`` or ``atlas-run-standalone`` commands. By default, this instance runs at ``http://localhost:2990/jira``. The ``options`` argument can be used to set the Jira instance to use. Authentication is handled with the ``basic_auth`` or ``token_auth`` argument. If authentication is supplied (and is accepted by Jira), the client will remember it for subsequent requests. For quick command line access to a server, see the ``jirashell`` script included with this distribution. The easiest way to instantiate is using ``j = JIRA("https://jira.atlasian.com")`` Args: server (Optional[str]): The server address and context path to use. Defaults to ``http://localhost:2990/jira``. options (Optional[Dict[str, bool, Any]]): Specify the server and properties this client will use. Use a dict with any of the following properties: * server -- the server address and context path to use. Defaults to ``http://localhost:2990/jira``. * rest_path -- the root REST path to use. Defaults to ``api``, where the Jira REST resources live. * rest_api_version -- the version of the REST resources under rest_path to use. Defaults to ``2``. * agile_rest_path - the REST path to use for Jira Agile requests. Defaults to ``agile``. * verify (Union[bool, str]) -- Verify SSL certs. (Default: ``True``). Or path to a CA_BUNDLE file or directory with certificates of trusted CAs, for the `requests` library to use. * client_cert (Union[str, Tuple[str,str]]) -- Path to file with both cert and key or a tuple of (cert,key), for the `requests` library to use for client side SSL. * check_update -- Check whether using the newest python-jira library version. * headers -- a dict to update the default headers the session uses for all API requests. basic_auth (Optional[Tuple[str, str]]): A tuple of username and password to use when establishing a session via HTTP BASIC authentication. token_auth (Optional[str]): A string containing the token necessary for (PAT) bearer token authorization. oauth (Optional[Any]): A dict of properties for OAuth authentication. The following properties are required: * access_token -- OAuth access token for the user * access_token_secret -- OAuth access token secret to sign with the key * consumer_key -- key of the OAuth application link defined in Jira * key_cert -- private key file to sign requests with (should be the pair of the public key supplied to Jira in the OAuth application link) kerberos (bool): True to enable Kerberos authentication. (Default: ``False``) kerberos_options (Optional[Dict[str,str]]): A dict of properties for Kerberos authentication. The following properties are possible: * mutual_authentication -- string DISABLED or OPTIONAL. Example kerberos_options structure: ``{'mutual_authentication': 'DISABLED'}`` jwt (Optional[Any]): A dict of properties for JWT authentication supported by Atlassian Connect. The following properties are required: * secret -- shared secret as delivered during 'installed' lifecycle event (see https://developer.atlassian.com/static/connect/docs/latest/modules/lifecycle.html for details) * payload -- dict of fields to be inserted in the JWT payload, e.g. 'iss' Example jwt structure: ``{'secret': SHARED_SECRET, 'payload': {'iss': PLUGIN_KEY}}`` validate (bool): True makes your credentials first to be validated. Remember that if you are accessing Jira as anonymous it will fail. (Default: ``False``). get_server_info (bool): True fetches server version info first to determine if some API calls are available. (Default: ``True``). async_ (bool): True enables async requests for those actions where we implemented it, like issue update() or delete(). (Default: ``False``). async_workers (int): Set the number of worker threads for async operations. timeout (Optional[Union[Union[float, int], Tuple[float, float]]]): Set a read/connect timeout for the underlying calls to Jira. Obviously this means that you cannot rely on the return code when this is enabled. max_retries (int): Sets the amount Retries for the HTTP sessions initiated by the client. (Default: ``3``) proxies (Optional[Any]): Sets the proxies for the HTTP session. auth (Optional[Tuple[str,str]]): Set a cookie auth token if this is required. logging (bool): True enables loglevel to info => else critical. (Default: ``True``) default_batch_sizes (Optional[Dict[Type[Resource], Optional[int]]]): Manually specify the batch-sizes for the paginated retrieval of different item types. `Resource` is used as a fallback for every item type not specified. If an item type is mapped to `None` no fallback occurs, instead the JIRA-backend will use its default batch-size. By default all Resources will be queried in batches of 100. E.g., setting this to ``{Issue: 500, Resource: None}`` will make :py:meth:`search_issues` query Issues in batches of 500, while every other item type's batch-size will be controlled by the backend. (Default: None)
def add_attachment(self, issue:
Union[ str, int]
, attachment: Union[ str, BufferedReader]
, filename: str
= None) -> Attachment
:
(source)
¶
Attach an attachment to an issue and returns a Resource for it. The client will *not* attempt to open or validate the attachment; it expects a file-like object to be ready for its use. The user is still responsible for tidying up (e.g., closing the file, killing the socket, etc.) Args: issue (Union[str, int]): the issue to attach the attachment to attachment (Union[str,BufferedReader]): file-like object to attach to the issue, also works if it is a string with the filename. filename (str): optional name for the attached file. If omitted, the file object's ``name`` attribute is used. If you acquired the file-like object by any other method than ``open()``, make sure that a name is specified in one way or the other. Returns: Attachment
def add_comment(self, issue:
Union[ str, int]
, body: str
, visibility: Optional[ Dict[ str, str]]
= None, is_internal: bool
= False) -> Comment
:
(source)
¶
Add a comment from the current authenticated user on the specified issue and return a Resource for it. Args: issue (Union[str, int]): ID or key of the issue to add the comment to body (str): Text of the comment to add visibility (Optional[Dict[str, str]]): a dict containing two entries: "type" and "value". "type" is 'role' (or 'group' if the Jira server has configured comment visibility for groups) "value" is the name of the role (or group) to which viewing of this comment will be restricted. is_internal (bool): True marks the comment as 'Internal' in Jira Service Desk (Default: ``False``) Returns: Comment: the created comment
Create a new group in Jira. Args: groupname (str): The name of the group you wish to create. Returns: bool: True if successful.
def add_issue_property(self, issue:
str
, key: str
, data) -> Response
:
(source)
¶
Add or update a specific issue property Resource. Args: issue (str): ID or key of the issue to set the property to key (str): Key of the property to set data: The data to set for the property Returns: Response
str
, issue_keys: Union[ str, List[ str]]
, ignore_epics: bool
= None) -> Response
:
(source)
¶
Add the issues in ``issue_keys`` to the ``epic_id``. Issues can only exist in one Epic! Args: epic_id (str): The ID for the epic where issues should be added. issue_keys (Union[str, List[str]]): The list (or comma separated str) of issues to add to the epic ignore_epics (bool): Deprecated. Returns: Response
Add the issues in ``issue_keys`` to the ``sprint_id``. The sprint must be started but not completed. If a sprint was completed, then have to also edit the history of the issue so that it was added to the sprint before it was completed, preferably before it started. A completed sprint's issues also all have a resolution set before the completion date. If a sprint was not started, then have to edit the marker and copy the rank of each issue too. Args: sprint_id (int): the sprint to add issues to issue_keys (List[str]): the issues to add to the sprint Returns: Response
str
, destination: Union[ Issue, Dict[ str, Any]]
, globalId: Optional[ str]
= None, application: Optional[ Dict[ str, Any]]
= None, relationship: Optional[ str]
= None) -> RemoteLink
:
(source)
¶
Add a remote link from an issue to an external application and returns a remote link Resource for it. ``destination`` should be a dict containing at least ``url`` to the linked external URL and ``title`` to display for the link inside Jira. For definitions of the allowable fields for ``destination`` and the keyword arguments ``globalId``, ``application`` and ``relationship``, see https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+for+Remote+Issue+Links. Args: issue (str): the issue to add the remote link to destination (Union[Issue, Dict[str, Any]]): the link details to add (see the above link for details) globalId (Optional[str]): unique ID for the link (see the above link for details) application (Optional[Dict[str,Any]]): application information for the link (see the above link for details) relationship (Optional[str]): relationship description for the link (see the above link for details) Returns: RemoteLink: the added remote link
Add a simple remote link from an issue to web resource. This avoids the admin access problems from add_remote_link by just using a simple object and presuming all fields are correct and not requiring more complex ``application`` data. ``object`` should be a dict containing at least ``url`` to the linked external URL and ``title`` to display for the link inside Jira For definitions of the allowable fields for ``object`` , see https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+for+Remote+Issue+Links. Args: issue (str): the issue to add the remote link to object (Dict[str,Any]): the dictionary used to create remotelink data Returns: RemoteLink
str
, email: str
, directoryId: int
= 1, password: str
= None, fullname: str
= None, notify: bool
= False, active: bool
= True, ignore_existing: bool
= False, application_keys: Optional[ List]
= None):
(source)
¶
Create a new Jira user. Args: username (str): the username of the new user email (str): email address of the new user directoryId (int): The directory ID the new user should be a part of (Default: ``1``) password (Optional[str]): Optional, the password for the new user fullname (Optional[str]): Optional, the full name of the new user notify (bool): True to send a notification to the new user. (Default: ``False``) active (bool): True to make the new user active upon creation. (Default: ``True``) ignore_existing (bool): True to ignore existing users. (Default: ``False``) application_keys (Optional[list]): Keys of products user should have access to Raises: JIRAError: If username already exists and `ignore_existing` has not been set to `True`. Returns: bool: Whether the user creation was successful.
Add a user to an existing group. Args: username (str): Username that will be added to specified group. group (str): Group that the user will be added to. Returns: Union[bool,Dict[str,Any]]: json response from Jira server for success or a value that evaluates as False in case of failure.
Register a vote for the current authenticated user on an issue. Args: issue (Union[str, int]): ID or key of the issue to vote on Returns: Response
def add_watcher(self, issue:
Union[ str, int]
, watcher: str
) -> Response
:
(source)
¶
Add a user to an issue's watchers list. Args: issue (Union[str, int]): ID or key of the issue affected watcher (str): name of the user to add to the watchers list Returns: Response
def add_worklog(self, issue:
Union[ str, int]
, timeSpent: Optional[ str]
= None, timeSpentSeconds: Optional[ str]
= None, adjustEstimate: Optional[ str]
= None, newEstimate: Optional[ str]
= None, reduceBy: Optional[ str]
= None, comment: Optional[ str]
= None, started: Optional[ datetime.datetime]
= None, user: Optional[ str]
= None) -> Worklog
:
(source)
¶
Add a new worklog entry on an issue and return a Resource for it. Args: issue (Union[str, int]): the issue to add the worklog to timeSpent (Optional[str]): a worklog entry with this amount of time spent, e.g. "2d" timeSpentSeconds (Optional[str]): a worklog entry with this amount of time spent in seconds adjustEstimate (Optional[str]): allows the user to provide specific instructions to update the remaining time estimate of the issue. The value can either be ``new``, ``leave``, ``manual`` or ``auto`` (default). newEstimate (Optional[str]): the new value for the remaining estimate field. e.g. "2d" reduceBy (Optional[str]): the amount to reduce the remaining estimate by e.g. "2d" comment (Optional[str]): optional worklog comment started (Optional[datetime.datetime]): Moment when the work is logged, if not specified will default to now user (Optional[str]): the user ID or name to use for this worklog Returns: Worklog
str
= None) -> Union[ Dict[ str, str], List[ Dict[ str, str]]]
:
(source)
¶
Return the mutable server application properties. Args: key (Optional[str]): the single property to return a value for Returns: Union[Dict[str, str], List[Dict[str, str]]]
def assign_issue(self, issue:
Union[ int, str]
, assignee: Optional[ str]
) -> bool
:
(source)
¶
Assign an issue to a user. Args: issue (Union[int, str]): the issue ID or key to assign assignee (str): the user to assign the issue to. None will set it to unassigned. -1 will set it to Automatic. Returns: bool
Execute all asynchronous jobs and wait for them to finish. By default it will run on 10 threads. Args: size (int): number of threads to run on.
Get an attachment Resource from the server for the specified ID. Args: id (str): The Attachment ID Returns: Attachment
str
= 'backup.zip', attachments: bool
= False) -> Optional[ Union[ bool, int]]
:
(source)
¶
Will call jira export to backup as zipped xml. Returning with success does not mean that the backup process finished. Args: filename (str): the filename for the backup (Default: "backup.zip") attachments (bool): True to also backup attachments (Default: ``False``) Returns: Union[bool, int]: Returns True if successful else it returns the statuscode of the Response or False
Return boolean based on 'alternativePercentage' and 'size' returned from backup_progress (cloud only).
Return status of cloud backup as a dict. Is there a way to get progress for Server version? Returns: Optional[Dict[str, Any]]
def boards(self, startAt:
int
= 0, maxResults: int
= 50, type: str
= None, name: str
= None, projectKeyOrID=None) -> ResultList[ Board]
:
(source)
¶
Get a list of board resources. Args: startAt: The starting index of the returned boards. Base index: 0. maxResults: The maximum number of boards to return per page. Default: 50 type: Filters results to boards of the specified type. Valid values: scrum, kanban. name: Filters results to boards that match or partially match the specified name. projectKeyOrID: Filters results to boards that match the specified project key or ID. Returns: ResultList[Board]
def comment(self, issue:
Union[ int, str]
, comment: str
, expand: Optional[ str]
= None) -> Comment
:
(source)
¶
Get a comment Resource from the server for the specified ID. Args: issue (Union[int, str]): the issue ID or key to get the comment from comment (str): ID of the comment to get expand (Optional[str]): extra information to fetch for each comment such as renderedBody and properties. Returns: Comment
def comments(self, issue:
Union[ int, str]
, expand: Optional[ str]
= None) -> List[ Comment]
:
(source)
¶
Get a list of comment Resources of the issue provided. Args: issue (Union[int, str]): the issue ID or key to get the comments from expand (Optional[str]): extra information to fetch for each comment such as renderedBody and properties. Returns: List[Comment]
def confirm_project_avatar(self, project:
str
, cropping_properties: Dict[ str, Any]
):
(source)
¶
Confirm the temporary avatar image previously uploaded with the specified cropping. After a successful registry with :py:meth:`create_temp_project_avatar`, use this method to confirm the avatar for use. The final avatar can be a subarea of the uploaded image, which is customized with the ``cropping_properties``: the return value of :py:meth:`create_temp_project_avatar` should be used for this argument. Args: project (str): ID or key of the project to confirm the avatar in cropping_properties (Dict[str,Any]): a dict of cropping properties from :py:meth:`create_temp_project_avatar`
Confirm the temporary avatar image previously uploaded with the specified cropping. After a successful registry with :py:meth:`create_temp_user_avatar`, use this method to confirm the avatar for use. The final avatar can be a subarea of the uploaded image, which is customized with the ``cropping_properties``: the return value of :py:meth:`create_temp_user_avatar` should be used for this argument. Args: user (str): the user to confirm the avatar for cropping_properties (Dict[str,Any]): a dict of cropping properties from :py:meth:`create_temp_user_avatar`
str
, filter_id: str
, project_ids: str
= None, preset: str
= 'scrum', location_type: Literal[ 'user', 'project']
= 'user', location_id: Optional[ str]
= None) -> Board
:
(source)
¶
Create a new board for the ``project_ids``. Args: name (str): name of the Board (<255 characters). filter_id (str): the Filter to use to create the Board. Note: if the user does not have the 'Create shared objects' permission and tries to create a shared board, a private board will be created instead (remember that board sharing depends on the filter sharing). project_ids (str): Deprecated. See location_id. preset (str): What preset/type to use for this Board, options: kanban, scrum, agility. (Default: "scrum") location_type (str): the location type. Available in Cloud. (Default: "user") location_id (Optional[str]): aka ``projectKeyOrId``. The id of Project that the Board should be located under. Omit this for a 'user' location_type. Available in Cloud. Returns: Board: The newly created board
def create_component(self, name:
str
, project: str
, description=None, leadUserName=None, assigneeType=None, isAssigneeTypeValid=False) -> Component
:
(source)
¶
Create a component inside a project and return a Resource for it. Args: name (str): name of the component project (str): key of the project to create the component in description (str): a description of the component leadUserName (Optional[str]): the username of the user responsible for this component assigneeType (Optional[str]): see the ComponentBean.AssigneeType class for valid values isAssigneeTypeValid (bool): True specifies whether the assignee type is acceptable (Default: ``False``) Returns: Component
Create a new customer and return an issue Resource for it. Args: email (str): Customer Email displayName (str): Customer display name Returns: Customer
def create_customer_request(self, fields:
Dict[ str, Any]
= None, prefetch: bool
= True, **fieldargs) -> Issue
:
(source)
¶
Create a new customer request and return an issue Resource for it. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field -- if the fields argument is used, all other keyword arguments will be ignored. By default, the client will immediately reload the issue Resource created by this method in order to return a complete Issue object to the caller; this behavior can be controlled through the 'prefetch' argument. Jira projects may contain many issue types. Some issue screens have different requirements for fields in a new issue. This information is available through the 'createmeta' set of methods. Further examples are available here: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue Args: fields (Dict[str, Any]): a dict containing field names and the values to use. If present, all other keyword arguments will be ignored prefetch (bool): True reloads the created issue Resource so all of its data is present in the value returned (Default: ``True``) Returns: Issue
str
= None, description: str
= None, jql: str
= None, favourite: bool
= None) -> Filter
:
(source)
¶
Create a new filter and return a filter Resource for it. Args: name (str): name of the new filter description (str): Useful human-readable description of the new filter jql (str): query string that defines the filter favourite (Optional[bool]): True adds this filter to the current user's favorites (Default: ``None``) Returns: Filter
Optional[ Dict[ str, Any]]
= None, prefetch: bool
= True, **fieldargs) -> Issue
:
(source)
¶
Create a new issue and return an issue Resource for it. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field -- if the fields argument is used, all other keyword arguments will be ignored. By default, the client will immediately reload the issue Resource created by this method in order to return a complete Issue object to the caller; this behavior can be controlled through the 'prefetch' argument. Jira projects may contain many different issue types. Some issue screens have different requirements for fields in a new issue. This information is available through the 'createmeta' set of methods. Further examples are available here: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue Args: fields (Optional[Dict[str, Any]]): a dict containing field names and the values to use. If present, all other keyword arguments will be ignored prefetch (bool): True reloads the created issue Resource so all of its data is present in the value returned (Default: ``True``) Returns: Issue
def create_issue_link(self, type:
Union[ str, IssueLinkType]
, inwardIssue: str
, outwardIssue: str
, comment: Optional[ Dict[ str, Any]]
= None) -> Response
:
(source)
¶
Create a link between two issues. Args: type (Union[str,IssueLinkType]): the type of link to create inwardIssue: the issue to link from outwardIssue: the issue to link to comment (Optional[Dict[str, Any]]): a comment to add to the issues with the link. Should be a dict containing ``body`` and ``visibility`` fields: ``body`` being the text of the comment and ``visibility`` being a dict containing two entries: ``type`` and ``value``. ``type`` is ``role`` (or ``group`` if the Jira server has configured comment visibility for groups) and ``value`` is the name of the role (or group) to which viewing of this comment will be restricted. Returns: Response
List[ Dict[ str, Any]]
, prefetch: bool
= True) -> List[ Dict[ str, Any]]
:
(source)
¶
Bulk create new issues and return an issue Resource for each successfully created issue. See `create_issue` documentation for field information. Args: field_list (List[Dict[str, Any]]): a list of dicts each containing field names and the values to use. Each dict is an individual issue to create and is subject to its minimum requirements. prefetch (bool): True reloads the created issue Resource so all of its data is present in the value returned (Default: ``True``) Returns: List[Dict[str, Any]]
str
, name: str
= None, assignee: str
= None, ptype: str
= 'software', template_name: str
= None, avatarId=None, issueSecurityScheme=None, permissionScheme=None, projectCategory=None, notificationScheme=10000, categoryId=None, url: str
= ''):
(source)
¶
Create a project with the specified parameters. Args: key (str): Mandatory. Must match Jira project key requirements, usually only 2-10 uppercase characters. name (Optional[str]): If not specified it will use the key value. assignee (Optional[str]): key of the lead, if not specified it will use current user. ptype (Optional[str]): Determines the type of project should be created. template_name (Optional[str]): is used to create a project based on one of the existing project templates. If `template_name` is not specified, then it should use one of the default values. Returns: Union[bool,int]: Should evaluate to False if it fails otherwise it will be the new project id.
str
, board_id: int
, startDate: Optional[ Any]
= None, endDate: Optional[ Any]
= None) -> Sprint
:
(source)
¶
Create a new sprint for the ``board_id``. Args: name (str): Name of the sprint board_id (int): Which board the sprint should be assigned. startDate (Optional[Any]): Start date for the sprint. endDate (Optional[Any]): End date for the sprint. Returns: Sprint: The newly created Sprint
def create_temp_project_avatar(self, project:
str
, filename: str
, size: int
, avatar_img: bytes
, contentType: str
= None, auto_confirm: bool
= False):
(source)
¶
Register an image file as a project avatar. The avatar created is temporary and must be confirmed before it can be used. Avatar images are specified by a filename, size, and file object. By default, the client will attempt to autodetect the picture's content type this mechanism relies on libmagic and will not work out of the box on Windows systems (see `Their Documentation <https://filemagic.readthedocs.io/en/latest/guide.html>`_ for details on how to install support). The ``contentType`` argument can be used to explicitly set the value (note that Jira will reject any type other than the well-known ones for images, e.g. ``image/jpg``, ``image/png``, etc.) This method returns a dict of properties that can be used to crop a subarea of a larger image for use. This dict should be saved and passed to :py:meth:`confirm_project_avatar` to finish the avatar creation process. If you want to cut out the middleman and confirm the avatar with Jira's default cropping, pass the 'auto_confirm' argument with a truthy value and :py:meth:`confirm_project_avatar` will be called for you before this method returns. Args: project (str): ID or key of the project to create the avatar in filename (str): name of the avatar file size (int): size of the avatar file avatar_img (bytes): file-like object holding the avatar contentType (str): explicit specification for the avatar image's content-type auto_confirm (bool): True to automatically confirm the temporary avatar by calling :py:meth:`confirm_project_avatar` with the return value of this method. (Default: ``False``)
str
, filename: str
, size: int
, avatar_img: bytes
, contentType: Any
= None, auto_confirm: bool
= False):
(source)
¶
Register an image file as a user avatar. The avatar created is temporary and must be confirmed before it can be used. Avatar images are specified by a filename, size, and file object. By default, the client will attempt to autodetect the picture's content type: this mechanism relies on ``libmagic`` and will not work out of the box on Windows systems (see `Their Documentation <https://filemagic.readthedocs.io/en/latest/guide.html>`_ for details on how to install support). The ``contentType`` argument can be used to explicitly set the value (note that Jira will reject any type other than the well-known ones for images, e.g. ``image/jpg``, ``image/png``, etc.) This method returns a dict of properties that can be used to crop a subarea of a larger image for use. This dict should be saved and passed to :py:meth:`confirm_user_avatar` to finish the avatar creation process. If you want to cut out the middleman and confirm the avatar with Jira's default cropping, pass the ``auto_confirm`` argument with a truthy value and :py:meth:`confirm_user_avatar` will be called for you before this method returns. Args: user (str): User to register the avatar for filename (str): name of the avatar file size (int): size of the avatar file avatar_img (bytes): file-like object containing the avatar contentType (Optional[Any]): explicit specification for the avatar image's content-type auto_confirm (bool): True to automatically confirm the temporary avatar by calling :py:meth:`confirm_user_avatar` with the return value of this method. (Default: ``False``)
def create_version(self, name:
str
, project: str
, description: str
= None, releaseDate: Any
= None, startDate: Any
= None, archived: bool
= False, released: bool
= False) -> Version
:
(source)
¶
Create a version in a project and return a Resource for it. Args: name (str): name of the version to create project (str): key of the project to create the version in description (str): a description of the version releaseDate (Optional[Any]): the release date assigned to the version startDate (Optional[Any]): The start date for the version archived (bool): True to create an archived version. (Default: ``False``) released (bool): True to create a released version. (Default: ``False``) Returns: Version
Optional[ Union[ Tuple[ str, str], str]]
= None, projectIds: Union[ List, Tuple[ str, str]]
= [], issuetypeIds: Optional[ List[ str]]
= None, issuetypeNames: Optional[ str]
= None, expand: Optional[ str]
= None) -> Dict[ str, Any]
:
(source)
¶
Get the metadata required to create issues, optionally filtered by projects and issue types. Args: projectKeys (Optional[Union[Tuple[str, str], str]]): keys of the projects to filter the results with. Can be a single value or a comma-delimited string. May be combined with projectIds. projectIds (Union[List, Tuple[str, str]]): IDs of the projects to filter the results with. Can be a single value or a comma-delimited string. May be combined with projectKeys. issuetypeIds (Optional[List[str]]): IDs of the issue types to filter the results with. Can be a single value or a comma-delimited string. May be combined with issuetypeNames. issuetypeNames (Optional[str]): Names of the issue types to filter the results with. Can be a single value or a comma-delimited string. May be combined with issuetypeIds. expand (Optional[str]): extra information to fetch inside each resource. Returns: Dict[str, Any]
Union[ str, int]
, issueTypeId: Union[ str, int]
) -> Dict[ str, Any]
:
(source)
¶
Get the field metadata for a given project and issue type, required to create issues. This API was introduced in JIRA Server / DC 8.4 as a replacement for the more general purpose API 'createmeta'. For details see: https://confluence.atlassian.com/jiracore/createmeta-rest-endpoint-to-be-removed-975040986.html Args: projectIdOrKey (Union[str, int]): id or key of the project for which to get the metadata. issueTypeId (Union[str, int]): id of the issue type for which to get the metadata. Returns: Dict[str, Any]
Get the issue types metadata for a given project, required to create issues. This API was introduced in JIRA Server / DC 8.4 as a replacement for the more general purpose API 'createmeta'. For details see: https://confluence.atlassian.com/jiracore/createmeta-rest-endpoint-to-be-removed-975040986.html Args: projectIdOrKey (Union[str, int]): id or key of the project for which to get the metadata. Returns: Dict[str, Any]
Return the `accountId` (Cloud) else `username` of the current user. For anonymous users it will return a value that evaluates as False. Args: field (Optional[str]): the name of the identifier field. Defaults to "accountId" for Jira Cloud, else "username" Returns: str: User's `accountId` (Cloud) else `username`.
Get a custom field option Resource from the server. Args: id (str): ID of the custom field to use Returns: CustomFieldOption
Get a dashboard Resource from the server. Args: id (str): ID of the dashboard to get. Returns: Dashboard
Return a ResultList of Dashboard resources and a ``total`` count. Args: filter (Optional[str]): either "favourite" or "my", the type of dashboards to return startAt (int): index of the first dashboard to return (Default: ``0``) maxResults (int): maximum number of dashboards to return. If maxResults set to False, it will try to get all items in batches. (Default: ``20``) Returns: ResultList
Delete project from Jira. Args: pid (Union[str, Project]): Jira projectID or Project or slug Raises: JIRAError: If project not found or not enough permissions ValueError: If pid parameter is not Project, slug or ProjectID Returns: bool: True if project was deleted
def delete_project_avatar(self, project:
str
, avatar: str
) -> Response
:
(source)
¶
Delete a project's avatar. Args: project (str): ID or key of the project to delete the avatar from avatar (str): ID of the avatar to delete Returns: Response
def delete_remote_link(self, issue:
Union[ str, Issue]
, *, internal_id: Optional[ str]
= None, global_id: Optional[ str]
= None) -> Response
:
(source)
¶
Delete remote link from issue by internalId or globalId. Args: issue (str): Key (or Issue) of Issue internal_id (Optional[str]): InternalID of the remote link to delete global_id (Optional[str]): GlobalID of the remote link to delete Returns: Response
Deletes a Jira User. Args: username (str): Username to delete Returns: bool: Success of user deletion
Delete a user's avatar. Args: username (str): the user to delete the avatar from avatar (str): ID of the avatar to remove Returns: Response
Get the edit metadata for an issue. Args: issue (Union[str, int]): the issue to get metadata for Returns: Dict[str, Dict[str, Dict[str, Any]]]
Get a list of filter Resources which are the favourites of the currently authenticated user. Returns: List[Filter]
str
, ids: Union[ Tuple[ str, str], int, str]
= '') -> Resource
:
(source)
¶
Find Resource object for any addressable resource on the server. This method is a universal resource locator for any REST-ful resource in Jira. The argument ``resource_format`` is a string of the form ``resource``, ``resource/{0}``, ``resource/{0}/sub``, ``resource/{0}/sub/{1}``, etc. The format placeholders will be populated from the ``ids`` argument if present. The existing authentication session will be used. The return value is an untyped Resource object, which will not support specialized :py:meth:`.Resource.update` or :py:meth:`.Resource.delete` behavior. Moreover, it will not know to return an issue Resource if the client uses the resource issue path. For this reason, it is intended to support resources that are not included in the standard Atlassian REST API. Args: resource_format (str): the subpath to the resource string ids (Optional[Tuple]): values to substitute in the ``resource_format`` string Returns: Resource
Union[ str, int]
, transition_name: str
) -> Optional[ int]
:
(source)
¶
Get a transitionid available on the specified issue to the current user. Look at https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1074 for json reference Args: issue (Union[str, int]): ID or key of the issue to get the transitions from transition_name (str): name of transition we are looking for Returns: Optional[int]: returns the id is found None when it's not
For the specified issue type scheme, returns all of the associated projects. (Admin required). Args: id (str): The issue type scheme id. Returns: List[Project]: Associated Projects for the Issue Type Scheme.
def get_project_version_by_name(self, project:
str
, version_name: str
) -> Optional[ Version]
:
(source)
¶
Get a version Resource by its name present on a project. Args: project (str): ID or key of the project to get versions from version_name (str): name of the version to search for Returns: Optional[Version]
Get a group Resource from the server. Args: id (str): ID of the group to get expand (Optional[Any]): Extra information to fetch inside each resource Returns: Group
Return a hash or users with their information. Requires Jira 6.0 or will raise NotImplemented. Args: group (str): Name of the group.
Optional[ str]
= None, exclude: Optional[ Any]
= None, maxResults: int
= 9999) -> List[ str]
:
(source)
¶
Return a list of groups matching the specified criteria. Args: query (Optional[str]): filter groups by name with this string exclude (Optional[Any]): filter out groups by name with this string maxResults (int): maximum results to return. (Default: ``9999``) Returns: List[str]
Union[ Issue, str]
, fields: Optional[ str]
= None, expand: Optional[ str]
= None, properties: Optional[ str]
= None) -> Issue
:
(source)
¶
Get an issue Resource from the server. Args: id (Union[Issue, str]): ID or key of the issue to get fields (Optional[str]): comma-separated string of issue fields to include in the results expand (Optional[str]): extra information to fetch inside each resource properties (Optional[str]): extra properties to fetch inside each result Returns: Issue
Get an issue link Resource from the server. Args: id (str): ID of the issue link to get Returns: IssueLink
Get an issue link type Resource from the server. Args: id (str): ID of the issue link type to get Returns: IssueLinkType
Get a list of issue link type Resources from the server. Args: force (bool): True forces an update of the cached IssueLinkTypes. (Default: ``False``) Returns: List[IssueLinkType]
Get a list of issue property Resource from the server for an issue. Args: issue (str): ID or key of the issue to get properties from Returns: List[IssueProperty]
def issue_property(self, issue:
str
, key: str
) -> IssueProperty
:
(source)
¶
Get a specific issue property Resource from the server. Args: issue (str): ID or key of the issue to get the property from key (str): Key of the property to get Returns: IssueProperty
Get an issue type Resource from the server. Args: id (str): ID of the issue type to get Returns: IssueType
Get issue type by name. Args: name (str): Name of the issue type project (str): Key or ID of the project. If set, only issue types available for that project will be looked up. Returns: IssueType
Get all issue type schemes defined (Admin required). Returns: List[IssueTypeScheme]: All the Issue Type Schemes available to the currently logged in user.
Get a list of issue types available within the project. Each project has a set of valid issue types and each issue type has a set of valid statuses. The valid statuses for a given issue type can be extracted via: `issue_type_x.statuses` Returns: List[IssueType]
Destroy the user's current WebSudo session. Works only for non-cloud deployments, for others does nothing. Returns: Optional[Response]
Move issues in ``issue_keys`` to the backlog, removing them from all sprints that have not been completed. Args: issue_keys (List[str]): the issues to move to the backlog Raises: JIRAError: If moving issues to backlog fails Returns: Response
Move a version within a project's ordered version list and return a new version Resource for it. One, but not both, of ``after`` and ``position`` must be specified. Args: id (str): ID of the version to move after (str): the self attribute of a version to place the specified version after (that is, higher in the list) position (Optional[str]): the absolute position to move this version to: must be one of ``First``, ``Last``, ``Earlier``, or ``Later`` Returns: Version
Optional[ str]
= None, projectId: Optional[ str]
= None, issueKey: Optional[ str]
= None, issueId: Optional[ str]
= None, permissions: Optional[ str]
= None) -> Dict[ str, Dict[ str, Dict[ str, str]]]
:
(source)
¶
Get a dict of all available permissions on the server. ``permissions`` is a comma-separated value list of permission keys that is required in Jira Cloud. For possible and allowable permission values, see https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permission-schemes/#built-in-permissions Args: projectKey (Optional[str]): limit returned permissions to the specified project projectId (Optional[str]): limit returned permissions to the specified project issueKey (Optional[str]): limit returned permissions to the specified issue issueId (Optional[str]): limit returned permissions to the specified issue permissions (Optional[str]): limit returned permissions to the specified csv permission keys (cloud required field) Returns: Dict[str, Dict[str, Dict[str, str]]]
Get a priority Resource from the server. Args: id (str): ID of the priority to get Returns: Priority
Get a project Resource from the server. Args: id (str): ID or key of the project to get expand (Optional[str]): extra information to fetch for the project such as projectKeys and description. Returns: Project
Get a dict of all avatars for a project visible to the current authenticated user. Args: project (str): ID or key of the project to get avatars for
Get a list of component Resources present on a project. Args: project (str): ID or key of the project to get components from Returns: List[Component]
def project_issue_security_level_scheme(self, project:
str
) -> IssueSecurityLevelScheme
:
(source)
¶
Get a IssueSecurityLevelScheme Resource from the server. Args: project (str): ID or key of the project to get the IssueSecurityLevelScheme for Returns: IssueSecurityLevelScheme: The issue security level scheme
def project_notification_scheme(self, project:
str
) -> NotificationScheme
:
(source)
¶
Get a NotificationScheme Resource from the server. Args: project (str): ID or key of the project to get the NotificationScheme for Returns: NotificationScheme: The notification scheme
def project_permissionscheme(self, project:
str
) -> PermissionScheme
:
(source)
¶
Get a PermissionScheme Resource from the server. Args: project (str): ID or key of the project to get the permissionscheme for Returns: PermissionScheme: The permission scheme
def project_priority_scheme(self, project:
str
) -> PriorityScheme
:
(source)
¶
Get a PriorityScheme Resource from the server. Args: project (str): ID or key of the project to get the PriorityScheme for Returns: PriorityScheme: The priority scheme
Get a role Resource. Args: project (str): ID or key of the project to get the role from id (str): ID of the role to get Returns: Role
def project_roles(self, project:
str
) -> Dict[ str, Dict[ str, str]]
:
(source)
¶
Get a dict of role names to resource locations for a project. Args: project (str): ID or key of the project to get roles from Returns: Dict[str, Dict[str, str]]
Get a list of version Resources present on a project. Args: project (str): ID or key of the project to get versions from Returns: List[Version]
def project_workflow_scheme(self, project:
str
) -> WorkflowScheme
:
(source)
¶
Get a WorkflowScheme Resource from the server. Args: project (str): ID or key of the project to get the WorkflowScheme for Returns: WorkflowScheme: The workflow scheme
Get a list of project Resources from the server visible to the current authenticated user. Args: expand (Optional[str]): extra information to fetch for each project such as projectKeys and description. Returns: List[Project]
str
, next_issue: Optional[ str]
= None, prev_issue: Optional[ str]
= None) -> Response
:
(source)
¶
Rank an issue before/after another using the default Ranking field, the one named 'Rank'. Pass only ONE of `next_issue` or `prev_issue`. Args: issue (str): issue key of the issue to be ranked before/after the second one. next_issue (str): issue key that the first issue is to be ranked before. prev_issue (str): issue key that the first issue is to be ranked after. Returns: Response
Start jira re-indexing. Returns True if reindexing is in progress or not needed, or False. If you call reindex() without any parameters it will perform a background reindex only if Jira thinks it should do it. Args: force (bool): True to reindex even if Jira doesn't say this is needed. (Default: ``False``) background (bool): True to reindex in background, slower but does not impact the users. (Default: ``True``) Returns: bool: True if reindexing is in progress or not needed
def remote_link(self, issue:
Union[ str, int]
, id: str
) -> RemoteLink
:
(source)
¶
Get a remote link Resource from the server. Args: issue (Union[str, int]): the issue holding the remote link id (str): ID of the remote link Returns: RemoteLink
def remote_links(self, issue:
Union[ str, int]
) -> List[ RemoteLink]
:
(source)
¶
Get a list of remote link Resources from an issue. Args: issue (Union[str, int]): the issue to get remote links from Returns: List[RemoteLink]
Delete a group from the Jira instance. Args: groupname (str): The group to be deleted from the Jira instance. Returns: bool: Returns True on success.
Remove a user from a group. Args: username (str): The user to remove from the group. groupname (str): The group that the user will be removed from. Returns: bool
Remove the current authenticated user's vote from an issue. Args: issue (Union[str, int]): ID or key of the issue to remove vote on
def remove_watcher(self, issue:
Union[ str, int]
, watcher: str
) -> Response
:
(source)
¶
Remove a user from an issue's watch list. Args: issue (Union[str, int]): ID or key of the issue affected watcher (str): name of the user to remove from the watchers list Returns: Response
def rename_version(self, project:
str
, old_name: str
, new_name: str
):
(source)
¶
Rename a version Resource on a project. Args: project (str): ID or key of the project to get versions from old_name (str): old name of the version to rename new_name (str): new name of the version to rename
Returns request types supported by a service desk instance. Args: service_desk (ServiceDesk): The service desk instance. Returns: List[RequestType]
Get a resolution Resource from the server. Args: id (str): ID of the resolution to get Returns: Resolution
str
, issueKey: str
= None, projectKey: str
= None, startAt: int
= 0, maxResults: int
= 50) -> ResultList
:
(source)
¶
Get a list of user Resources that match a username string and have browse permission for the issue or project. Args: user (str): a string to match usernames against. issueKey (Optional[str]): find users with browse permission for this issue. projectKey (Optional[str]): find users with browse permission for this project. startAt (int): index of the first user to return. (Default: ``0``) maxResults (int): maximum number of users to return. If maxResults evaluates as False, it will try to get all items in batches. (Default: ``50``) Returns: ResultList
Optional[ str]
= None, project: Optional[ str]
= None, issueKey: Optional[ str]
= None, expand: Optional[ Any]
= None, startAt: int
= 0, maxResults: int
= 50, query: Optional[ str]
= None):
(source)
¶
Get a list of user Resources that match the search string for assigning or creating issues. "username" query parameter is deprecated in Jira Cloud; the expected parameter now is "query", which can just be the full email again. But the "user" parameter is kept for backwards compatibility, i.e. Jira Server/Data Center. This method is intended to find users that are eligible to create issues in a project or be assigned to an existing issue. When searching for eligible creators, specify a project. When searching for eligible assignees, specify an issue key. Args: username (Optional[str]): A string to match usernames against project (Optional[str]): Filter returned users by permission in this project (expected if a result will be used to create an issue) issueKey (Optional[str]): Filter returned users by this issue (expected if a result will be used to edit this issue) expand (Optional[Any]): Extra information to fetch inside each resource startAt (int): Index of the first user to return (Default: ``0``) maxResults (int): maximum number of users to return. If maxResults evaluates as False, it will try to get all items in batches. (Default: ``50``) query (Optional[str]): Search term. It can just be the email. Returns: ResultList
str
, projectKeys: str
, startAt: int
= 0, maxResults: int
= 50) -> ResultList
:
(source)
¶
Get a list of user Resources that match the search string and can be assigned issues for projects. Args: username (str): A string to match usernames against projectKeys (str): Comma-separated list of project keys to check for issue assignment permissions startAt (int): Index of the first user to return (Default: ``0``) maxResults (int): Maximum number of users to return. If maxResults evaluates as False, it will try to get all users in batches. (Default: ``50``) Returns: ResultList
str
, startAt: int
= 0, maxResults: int
= 50, validate_query: bool
= True, fields: Optional[ Union[ str, List[ str]]]
= '*all', expand: Optional[ str]
= None, properties: Optional[ str]
= None, json_result: bool
= False) -> Union[ Dict[ str, Any], ResultList[ Issue]]
:
(source)
¶
Get a :class:`~jira.client.ResultList` of issue Resources matching a JQL search string. Args: jql_str (str): The JQL search string. startAt (int): Index of the first issue to return. (Default: ``0``) maxResults (int): Maximum number of issues to return. Total number of results is available in the ``total`` attribute of the returned :class:`ResultList`. If maxResults evaluates to False, it will try to get all issues in batches. (Default: ``50``) validate_query (bool): True to validate the query. (Default: ``True``) fields (Optional[Union[str, List[str]]]): comma-separated string or list of issue fields to include in the results. Default is to include all fields. expand (Optional[str]): extra information to fetch inside each resource properties (Optional[str]): extra properties to fetch inside each result json_result (bool): True to return a JSON response. When set to False a :class:`ResultList` will be returned. (Default: ``False``) Returns: Union[Dict,ResultList]: Dict if ``json_result=True``
Optional[ str]
= None, startAt: int
= 0, maxResults: int
= 50, includeActive: bool
= True, includeInactive: bool
= False, query: Optional[ str]
= None) -> ResultList[ User]
:
(source)
¶
Get a list of user Resources that match the specified search string. "username" query parameter is deprecated in Jira Cloud; the expected parameter now is "query", which can just be the full email again. But the "user" parameter is kept for backwards compatibility, i.e. Jira Server/Data Center. Args: user (Optional[str]): a string to match usernames, name or email against. startAt (int): index of the first user to return. maxResults (int): maximum number of users to return. If maxResults evaluates as False, it will try to get all items in batches. includeActive (bool): True to include active users in the results. (Default: ``True``) includeInactive (bool): True to include inactive users in the results. (Default: ``False``) query (Optional[str]): Search term. It can just be the email. Returns: ResultList[User]
Get a security level Resource. Args: id (str): ID of the security level to get Returns: SecurityLevel
Get a Service Desk Resource from the server. Args: id (str): ID or key of the Service Desk to get Returns: ServiceDesk
Get a list of ServiceDesk Resources from the server visible to the current authenticated user. Returns: List[ServiceDesk]
Set the application property. Args: key (str): key of the property to set value (str): value to assign to the property
Set a project's avatar. Args: project (str): ID or key of the project to set the avatar on avatar (str): ID of the avatar to set
Set a user's avatar. Args: username (str): the user to set the avatar for avatar (str): ID of the avatar to set Returns: Response
Return the information about a sprint. Args: sprint_id (int): the sprint retrieving issues from Returns: Sprint
Return the information about a sprint. Args: board_id (str): the board retrieving issues from. Deprecated and ignored. sprint_id (str): the sprint retrieving issues from Returns: Dict[str, Any]
def sprints(self, board_id:
int
, extended: Optional[ bool]
= None, startAt: int
= 0, maxResults: int
= 50, state: str
= None) -> ResultList[ Sprint]
:
(source)
¶
Get a list of sprint Resources. Args: board_id (int): the board to get sprints from extended (bool): Deprecated. startAt (int): the index of the first sprint to return (0 based) maxResults (int): the maximum number of sprints to return state (str): Filters results to sprints in specified states. Valid values: `future`, `active`, `closed`. You can define multiple states separated by commas Returns: ResultList[Sprint]: List of sprints.
Union[ str, int]
, extended: bool
= False, state: str
= None) -> Dict[ str, Dict[ str, Any]]
:
(source)
¶
Get a dictionary of sprint Resources where the name of the sprint is the key. Args: board_id (int): the board to get sprints from extended (bool): Deprecated. state (str): Filters results to sprints in specified states. Valid values: `future`, `active`, `closed`. You can define multiple states separated by commas Returns: Dict[str, Dict[str, Any]]: dictionary of sprints with the sprint name as key
Get a status Resource from the server. Args: id (str): ID of the status resource to get Returns: Status
Get a status category Resource from the server. Args: id (int): ID of the status category resource to get Returns: StatusCategory
Get a list of all status Resources from the server. Refer to :py:meth:`JIRA.issue_types_for_project` for getting statuses for a specific issue type within a specific project. Returns: List[Status]
def transition_issue(self, issue:
Union[ str, int]
, transition: str
, fields: Optional[ Dict[ str, Any]]
= None, comment: Optional[ str]
= None, worklog: Optional[ str]
= None, **fieldargs):
(source)
¶
Perform a transition on an issue. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field -- if the fields argument is used, all other keyword arguments will be ignored. Field values will be set on the issue as part of the transition process. Args: issue (Union[str, int]): ID or key of the issue to perform the transition on transition (str): ID or name of the transition to perform fields (Optional[Dict[str,Any]]): a dict containing field names and the values to use. comment (Optional[str]): String to add as comment to the issue when performing the transition. worklog (Optional[str]): String to add as time spent on the issue when performing the transition. **fieldargs: If present, all other keyword arguments will be ignored
def transitions(self, issue:
Union[ str, int]
, id: Optional[ str]
= None, expand=None):
(source)
¶
Get a list of the transitions available on the specified issue to the current user. Args: issue (Union[str, int]): ID or key of the issue to get the transitions from id (Optional[str]): if present, get only the transition matching this ID expand (Optional): extra information to fetch inside each transition Returns: Any: json of response
str
= None, description: str
= None, jql: str
= None, favourite: bool
= None):
(source)
¶
Update a filter and return a filter Resource for it. Args: name (Optional[str]): name of the new filter description (Optional[str]): Useful human-readable description of the new filter jql (Optional[str]): query string that defines the filter favourite (Optional[bool]): True to add this filter to the current user's favorites (Default: ``None``)
Union[ str, int]
, name: Optional[ str]
= None, startDate: Optional[ Any]
= None, endDate: Optional[ Any]
= None, state: Optional[ str]
= None) -> Dict[ str, Any]
:
(source)
¶
Updates the sprint with the given values. Args: id (Union[str, int]): The id of the sprint to update name (Optional[str]): The name to update your sprint to startDate (Optional[Any]): The start date for the sprint endDate (Optional[Any]): The start date for the sprint state: (Optional[str]): The start date for the sprint Returns: Dict[str, Any]
Get a user Resource from the server. Args: id (str): ID of the user to get expand (Optional[Any]): Extra information to fetch inside each resource Returns: User
Get a dict of avatars for the specified user. Args: username (str): the username to get avatars for Returns: Dict[str, Any]
Get a version Resource. Args: id (str): ID of the version to get expand (Optional[Any]): extra information to fetch inside each resource Returns: Version
Get a dict of the counts of issues fixed and affected by a version. Args: id (str): the version to count issues for
Get the number of unresolved issues for a version. Args: id (str): ID of the version to count issues for
Get a votes Resource from the server. Args: issue (Union[str, int]): ID or key of the issue to get the votes for Returns: Votes
Get a watchers Resource from the server for an issue. Args: issue (Union[str, int]): ID or key of the issue to get the watchers for Returns: Watchers
Get a specific worklog Resource from the server. Args: issue (Union[str, int]): ID or key of the issue to get the worklog from id (str): ID of the worklog to get Returns: Worklog
Get a list of worklog Resources from the server for an issue. Args: issue (Union[str, int]): ID or key of the issue to get worklogs from Returns: List[Worklog]
Undocumented
Value |
|
Adds the client certificate to the session. If configured through the constructor. https://docs.python-requests.org/en/master/user/advanced/#client-side-certificates - str: a single file (containing the private key and the certificate) - Tuple[str,str] a tuple of both files’ paths
Adds verification strategy for host SSL certificates. If configured through the constructor. https://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification - str: Path to a `CA_BUNDLE` file or directory with certificates of trusted CAs. - bool: True/False
Tuple[ str, str]
, timeout: Optional[ Union[ None, float, Tuple[ float, float], Tuple[ float, None]]]
= None):
(source)
¶
Undocumented
str
, password: str
, timeout: Optional[ Union[ None, float, Tuple[ float, float], Tuple[ float, None]]]
= None):
(source)
¶
Creates a basic http session. Args: username (str): Username for the session password (str): Password for the username timeout (Optional[int]): If set determines the connection/read timeout delay for the Session. Returns: ResilientSession
Optional[ Union[ Union[ float, int], Tuple[ float, float]]]
):
(source)
¶
Undocumented
Optional[ Union[ None, float, Tuple[ float, float], Tuple[ float, None]]]
, kerberos_options=None):
(source)
¶
Undocumented
Optional[ Union[ Union[ float, int], Tuple[ float, float]]]
):
(source)
¶
Undocumented
str
, timeout: Optional[ Union[ None, float, Tuple[ float, float], Tuple[ float, None]]]
= None):
(source)
¶
Creates token-based session. Header structure: "authorization": "Bearer <token_auth>".
Type[ ResourceType]
, items_key: Optional[ str]
, request_path: str
, startAt: int
= 0, maxResults: int
= 50, params: Dict[ str, Any]
= None, base: str
= JIRA_BASE_URL) -> ResultList[ ResourceType]
:
(source)
¶
Fetch from a paginated end point. Args: item_type (Type[Resource]): Type of single item. ResultList of such items will be returned. items_key (Optional[str]): Path to the items in JSON returned from server. Set it to None, if response is an array, and not a JSON object. request_path (str): path in request URL startAt (int): index of the first record to be fetched. (Default: ``0``) maxResults (int): Maximum number of items to return. If maxResults evaluates as False, it will try to get all items in batches. (Default:50) params (Dict[str, Any]): Params to be used in all requests. Should not contain startAt and maxResults, as they will be added for each request created from this function. base (str): base URL to use for the requests. Returns: ResultList
Any
, ids: Union[ Tuple[ str, str], Tuple[ Union[ str, int], str], int, str]
, expand=None) -> Any
:
(source)
¶
Uses the find method of the provided Resource class. Args: resource_cls (Any): Any instance of :py:class`Resource` ids (Union[Tuple[str, str], int, str]): The arguments to the Resource's ``find()`` expand ([type], optional): The value for the expand property in the Resource's ``find()`` params. Defaults to None. Raises: JIRAError: If the Resource cannot be found Returns: Any: A class of the same type as ``resource_cls``
Return the batch size for the given resource type from the options. Check if specified item-type has a mapped batch-size, else try to fallback to batch-size assigned to `Resource`, else fallback to Backend-determined batch-size. Returns: Optional[int]: The batch size to use. When the configured batch size is None, the batch size should be determined by the JIRA-Backend.
Type[ ResourceType]
, items_key: Optional[ str]
, resource: Dict[ str, Any]
) -> List[ ResourceType]
:
(source)
¶
Undocumented
str
, params: Dict[ str, Any]
= None, base: str
= JIRA_BASE_URL):
(source)
¶
Get the json for a given path and params. Args: path (str): The subpath required params (Optional[Dict[str, Any]]): Parameters to filter the json query. base (Optional[str]): The Base Jira URL, defaults to the instance base. Returns: Union[Dict[str, Any], List[Dict[str, str]]]
Returns the full url based on Jira base url and the path provided. Using the latest API endpoint. Args: path (str): The subpath desired. base (Optional[str]): The base url which should be prepended to the path Returns: str: Fully qualified URL
Get the MIME type for a given stream of bytes. Args: buff (bytes): Stream of bytes Returns: Optional[str]: the MIME type
Returns the full url based on Jira base url and the path provided. Using the API version specified during the __init__. Args: path (str): The subpath desired. base (Optional[str]): The base url which should be prepended to the path Returns: str: Fully qualified URL
Internal method for translating a user search (str) to an id. Return None and -1 unchanged. This function uses :py:meth:`JIRA.search_users` to find the user and then using :py:meth:`JIRA._get_user_identifier` extracts the relevant identifier property depending on whether the instance is a Cloud or self-hosted Instance. Args: user (Optional[str]): The search term used for finding a user. None, '-1' and -1 are equivalent to 'Unassigned'. Raises: JIRAError: If any error occurs. Returns: Optional[str]: The Jira user's identifier. Or "-1" and None unchanged.
Get the unique identifier depending on the deployment type. - Cloud: 'accountId' - Self Hosted: 'name' (equivalent to username). Args: user (User): a User object Returns: str: the User's unique identifier.