#
tokens: 37106/50000 1/48 files (page 3/4)
lines: on (toggle) GitHub
raw markdown copy reset
This is page 3 of 4. Use http://codebase.md/infinitiq-tech/mcp-jira?lines=true&page={x} to view the full context.

# Directory Structure

```
├── .env.example
├── .github
│   ├── copilot-instructions.md
│   └── ISSUE_TEMPLATE
│       ├── bug_report.yml
│       ├── config.yml
│       ├── copilot.yml
│       ├── story.yml
│       └── task.yml
├── .gitignore
├── .lock
├── bin
│   ├── activate
│   ├── activate.csh
│   ├── activate.fish
│   ├── Activate.ps1
│   ├── dotenv
│   ├── httpx
│   ├── jirashell
│   ├── mcp
│   ├── mcp-server-jira
│   ├── normalizer
│   ├── pip
│   ├── pip3
│   ├── pip3.10
│   ├── python
│   ├── python3
│   ├── python3.10
│   └── uvicorn
├── claude_reference
│   ├── jira_advanced.txt
│   ├── jira_api_documentation.txt
│   ├── jira_examples.txt
│   ├── jira_installation.md
│   └── jira_shell.txt
├── Dockerfile
├── docs
│   └── create_issues_v3_conversion.md
├── glama.json
├── jira.py
├── LICENSE
├── mcp
│   ├── __init__.py
│   ├── server
│   │   └── __init__.py
│   └── types
│       └── __init__.py
├── MCPReadme.md
├── pyproject.toml
├── pytest.ini
├── pyvenv.cfg
├── README.md
├── run_server.py
├── src
│   ├── __init__.py
│   ├── mcp
│   │   ├── __init__.py
│   │   ├── server
│   │   │   ├── __init__.py
│   │   │   └── stdio.py
│   │   └── types
│   │       └── __init__.py
│   └── mcp_server_jira
│       ├── __init__.py
│       ├── __main__.py
│       ├── jira_v3_api.py
│       └── server.py
├── tests
│   ├── __init__.py
│   ├── test_add_comment_v3_api_only.py
│   ├── test_bulk_create_issues_v3_api.py
│   ├── test_create_issue_v3_api_only.py
│   ├── test_create_issues_integration.py
│   ├── test_create_jira_issues_server.py
│   ├── test_get_transitions_v3.py
│   ├── test_jira_v3_api.py
│   ├── test_search_issues_v3_api.py
│   ├── test_server.py
│   └── test_transition_issue_v3_api_only.py
└── uv.lock
```

# Files

--------------------------------------------------------------------------------
/claude_reference/jira_api_documentation.txt:
--------------------------------------------------------------------------------

```
   1 | 6. API Documentation
   2 | 6.1. jira package
   3 | 6.1.1. jira.client module
   4 | Jira Client module.
   5 | 
   6 | This module implements a friendly (well, friendlier) interface between the raw JSON responses from Jira and the Resource/dict abstractions provided by this library. Users will construct a JIRA object as described below. Full API documentation can be found at: https://jira.readthedocs.io/en/latest/.
   7 | 
   8 | jira.client.cloud_api(client_method: Callable) → Callable[source]
   9 | A convenience decorator to check if the Jira instance is cloud.
  10 | 
  11 | Checks if the client instance is talking to Cloud Jira. If it is, return the result of the called client method. If not, return None and log a warning.
  12 | 
  13 | Parameters:
  14 | client_method – The method that is being called by the client.
  15 | 
  16 | Returns:
  17 | Either the result of the wrapped function or None.
  18 | 
  19 | Raises:
  20 | JIRAError – In the case the error is not an HTTP error with a status code.
  21 | 
  22 | NotJIRAInstanceError – In the case that the first argument to this method is not a client.JIRA instance.
  23 | 
  24 | jira.client.experimental_atlassian_api(client_method: Callable) → Callable[source]
  25 | A convenience decorator to inform if a client method is experimental.
  26 | 
  27 | Indicates the path covered by the client method is experimental. If the path disappears or the method becomes disallowed, this logs an error and returns None. If another kind of exception is raised, this reraises.
  28 | 
  29 | Raises:
  30 | JIRAError – In the case the error is not an HTTP error with a status code.
  31 | 
  32 | NotJIRAInstanceError – In the case that the first argument to this method is is not a client.JIRA instance.
  33 | 
  34 | Returns:
  35 | Either the result of the wrapped function or None.
  36 | 
  37 | jira.client.translate_resource_args(func: Callable)[source]
  38 | Decorator that converts Issue and Project resources to their keys when used as arguments.
  39 | 
  40 | Parameters:
  41 | func (Callable) – the function to decorate
  42 | 
  43 | class jira.client.ResultList(iterable: Iterable | None = None, _startAt: int = 0, _maxResults: int = 0, _total: int | None = None, _isLast: bool | None = None)[source]
  44 | Bases: list, Generic[ResourceType]
  45 | 
  46 | __init__(iterable: Iterable | None = None, _startAt: int = 0, _maxResults: int = 0, _total: int | None = None, _isLast: bool | None = None) → None[source]
  47 | Results List.
  48 | 
  49 | Parameters:
  50 | iterable (Iterable) – [description]. Defaults to None.
  51 | 
  52 | _startAt (int) – Start page. Defaults to 0.
  53 | 
  54 | _maxResults (int) – Max results per page. Defaults to 0.
  55 | 
  56 | _total (Optional[int]) – Total results from query. Defaults to 0.
  57 | 
  58 | _isLast (Optional[bool]) – True to mark this page is the last page? (Default: None). see The official API docs
  59 | 
  60 | class jira.client.QshGenerator(context_path)[source]
  61 | Bases: object
  62 | 
  63 | __init__(context_path)[source]
  64 | class jira.client.JiraCookieAuth(session: ResilientSession, session_api_url: str, auth: tuple[str, str])[source]
  65 | Bases: AuthBase
  66 | 
  67 | Jira Cookie Authentication.
  68 | 
  69 | Allows using cookie authentication as described by jira api docs
  70 | 
  71 | __init__(session: ResilientSession, session_api_url: str, auth: tuple[str, str])[source]
  72 | Cookie Based Authentication.
  73 | 
  74 | Parameters:
  75 | session (ResilientSession) – The Session object to communicate with the API.
  76 | 
  77 | session_api_url (str) – The session api url to use.
  78 | 
  79 | auth (Tuple[str, str]) – The username, password tuple.
  80 | 
  81 | property cookies
  82 | init_session()[source]
  83 | Initialise the Session object’s cookies, so we can use the session cookie.
  84 | 
  85 | Raises HTTPError if the post returns an erroring http response
  86 | 
  87 | handle_401(response: Response, **kwargs) → Response[source]
  88 | Refresh cookies if the session cookie has expired. Then retry the request.
  89 | 
  90 | Parameters:
  91 | response (requests.Response) – the response with the possible 401 to handle
  92 | 
  93 | Returns:
  94 | requests.Response
  95 | 
  96 | process_original_request(original_request: PreparedRequest)[source]
  97 | update_cookies(original_request: PreparedRequest)[source]
  98 | send_request(request: PreparedRequest)[source]
  99 | class jira.client.TokenAuth(token: str)[source]
 100 | Bases: AuthBase
 101 | 
 102 | Bearer Token Authentication.
 103 | 
 104 | __init__(token: str)[source]
 105 | class jira.client.JIRA(server: str | None = None, options: dict[str, str | bool | Any] | None = None, basic_auth: tuple[str, str] | None = None, token_auth: str | None = None, oauth: dict[str, Any] | None = None, jwt: dict[str, Any] | None = None, kerberos=False, kerberos_options: dict[str, Any] | None = 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 = None, timeout: None | float | tuple[float, float] | tuple[float, None] = None, auth: tuple[str, str] | None = None, default_batch_sizes: dict[type[Resource], int | None] | None = None)[source]
 106 | Bases: object
 107 | 
 108 | User interface to Jira.
 109 | 
 110 | 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 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.
 111 | 
 112 | 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.
 113 | 
 114 | 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.
 115 | 
 116 | For quick command line access to a server, see the jirashell script included with this distribution.
 117 | 
 118 | The easiest way to instantiate is using j = JIRA("https://jira.atlassian.com")
 119 | 
 120 | DEFAULT_OPTIONS = {'agile_rest_api_version': '1.0', 'agile_rest_path': 'agile', 'async': False, 'async_workers': 5, 'auth_url': '/rest/auth/1/session', 'check_update': False, 'client_cert': None, 'context_path': '/', 'default_batch_size': {<class 'jira.resources.Resource'>: 100}, 'delay_reload': 0, 'headers': {'Cache-Control': 'no-cache', 'Content-Type': 'application/json', 'X-Atlassian-Token': 'no-check'}, 'resilient': True, 'rest_api_version': '2', 'rest_path': 'api', 'server': 'http://localhost:2990/jira', 'verify': True}
 121 | checked_version = False
 122 | JIRA_BASE_URL = '{server}/rest/{rest_path}/{rest_api_version}/{path}'
 123 | AGILE_BASE_URL = '{server}/rest/{agile_rest_path}/{agile_rest_api_version}/{path}'
 124 | __init__(server: str | None = None, options: dict[str, str | bool | Any] | None = None, basic_auth: tuple[str, str] | None = None, token_auth: str | None = None, oauth: dict[str, Any] | None = None, jwt: dict[str, Any] | None = None, kerberos=False, kerberos_options: dict[str, Any] | None = 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 = None, timeout: None | float | tuple[float, float] | tuple[float, None] = None, auth: tuple[str, str] | None = None, default_batch_sizes: dict[type[Resource], int | None] | None = None)[source]
 125 | Construct a Jira client instance.
 126 | 
 127 | 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.
 128 | 
 129 | 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.
 130 | 
 131 | For quick command line access to a server, see the jirashell script included with this distribution.
 132 | 
 133 | The easiest way to instantiate is using j = JIRA("https://jira.atlasian.com")
 134 | 
 135 | Parameters:
 136 | server (Optional[str]) – The server address and context path to use. Defaults to http://localhost:2990/jira.
 137 | 
 138 | options (Optional[Dict[str, bool, Any]]) –
 139 | 
 140 | Specify the server and properties this client will use. Use a dict with any of the following properties:
 141 | 
 142 | server – the server address and context path to use. Defaults to http://localhost:2990/jira.
 143 | 
 144 | rest_path – the root REST path to use. Defaults to api, where the Jira REST resources live.
 145 | 
 146 | rest_api_version – the version of the REST resources under rest_path to use. Defaults to 2.
 147 | 
 148 | agile_rest_path - the REST path to use for Jira Agile requests. Defaults to agile.
 149 | 
 150 | 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.
 151 | 
 152 | 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.
 153 | 
 154 | check_update – Check whether using the newest python-jira library version.
 155 | 
 156 | headers – a dict to update the default headers the session uses for all API requests.
 157 | 
 158 | basic_auth (Optional[Tuple[str, str]]) – A tuple of username and password to use when establishing a session via HTTP BASIC authentication.
 159 | 
 160 | token_auth (Optional[str]) – A string containing the token necessary for (PAT) bearer token authorization.
 161 | 
 162 | oauth (Optional[Any]) –
 163 | 
 164 | A dict of properties for OAuth authentication. The following properties are required:
 165 | 
 166 | access_token – OAuth access token for the user
 167 | 
 168 | access_token_secret – OAuth access token secret to sign with the key
 169 | 
 170 | consumer_key – key of the OAuth application link defined in Jira
 171 | 
 172 | 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)
 173 | 
 174 | signature_method (Optional) – The signature method to use with OAuth. Defaults to oauthlib.oauth1.SIGNATURE_HMAC_SHA1
 175 | 
 176 | kerberos (bool) – True to enable Kerberos authentication. (Default: False)
 177 | 
 178 | kerberos_options (Optional[Dict[str,str]]) –
 179 | 
 180 | A dict of properties for Kerberos authentication. The following properties are possible:
 181 | 
 182 | mutual_authentication – string DISABLED or OPTIONAL.
 183 | 
 184 | Example kerberos_options structure: {'mutual_authentication': 'DISABLED'}
 185 | 
 186 | jwt (Optional[Any]) –
 187 | 
 188 | A dict of properties for JWT authentication supported by Atlassian Connect. The following properties are required:
 189 | 
 190 | secret – shared secret as delivered during ‘installed’ lifecycle event (see https://developer.atlassian.com/static/connect/docs/latest/modules/lifecycle.html for details)
 191 | 
 192 | payload – dict of fields to be inserted in the JWT payload, e.g. ‘iss’
 193 | 
 194 | Example jwt structure: {'secret': SHARED_SECRET, 'payload': {'iss': PLUGIN_KEY}}
 195 | 
 196 | validate (bool) – True makes your credentials first to be validated. Remember that if you are accessing Jira as anonymous it will fail. (Default: False).
 197 | 
 198 | get_server_info (bool) – True fetches server version info first to determine if some API calls are available. (Default: True).
 199 | 
 200 | async (bool) – True enables async requests for those actions where we implemented it, like issue update() or delete(). (Default: False).
 201 | 
 202 | async_workers (int) – Set the number of worker threads for async operations.
 203 | 
 204 | 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.
 205 | 
 206 | max_retries (int) – Sets the amount Retries for the HTTP sessions initiated by the client. (Default: 3)
 207 | 
 208 | proxies (Optional[Any]) – Sets the proxies for the HTTP session.
 209 | 
 210 | auth (Optional[Tuple[str,str]]) – Set a cookie auth token if this is required.
 211 | 
 212 | logging (bool) – True enables loglevel to info => else critical. (Default: True)
 213 | 
 214 | 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 search_issues() query Issues in batches of 500, while every other item type’s batch-size will be controlled by the backend. (Default: None)
 215 | 
 216 | property server_url: str
 217 | Return the server url.
 218 | 
 219 | Returns:
 220 | str
 221 | 
 222 | close()[source]
 223 | client_info() → str[source]
 224 | Get the server this client is connected to.
 225 | 
 226 | find(resource_format: str, ids: tuple[str, str] | int | str = '') → Resource[source]
 227 | Find Resource object for any addressable resource on the server.
 228 | 
 229 | 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.
 230 | 
 231 | The return value is an untyped Resource object, which will not support specialized Resource.update() or 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.
 232 | 
 233 | Parameters:
 234 | resource_format (str) – the subpath to the resource string
 235 | 
 236 | ids (Optional[Tuple]) – values to substitute in the resource_format string
 237 | 
 238 | Returns:
 239 | Resource
 240 | 
 241 | async_do(size: int = 10)[source]
 242 | Execute all asynchronous jobs and wait for them to finish. By default it will run on 10 threads.
 243 | 
 244 | Parameters:
 245 | size (int) – number of threads to run on.
 246 | 
 247 | application_properties(key: str | None = None) → dict[str, str] | list[dict[str, str]][source]
 248 | Return the mutable server application properties.
 249 | 
 250 | Parameters:
 251 | key (Optional[str]) – the single property to return a value for
 252 | 
 253 | Returns:
 254 | Union[Dict[str, str], List[Dict[str, str]]]
 255 | 
 256 | set_application_property(key: str, value: str)[source]
 257 | Set the application property.
 258 | 
 259 | Parameters:
 260 | key (str) – key of the property to set
 261 | 
 262 | value (str) – value to assign to the property
 263 | 
 264 | applicationlinks(cached: bool = True) → list[source]
 265 | List of application links.
 266 | 
 267 | Returns:
 268 | List[Dict] – json, or empty list
 269 | 
 270 | attachment(id: str) → Attachment[source]
 271 | Get an attachment Resource from the server for the specified ID.
 272 | 
 273 | Parameters:
 274 | id (str) – The Attachment ID
 275 | 
 276 | Returns:
 277 | Attachment
 278 | 
 279 | attachment_meta() → dict[str, int][source]
 280 | Get the attachment metadata.
 281 | 
 282 | Returns:
 283 | Dict[str, int]
 284 | 
 285 | add_attachment(issue: str | int, attachment: str | BufferedReader, filename: str | None = None) → Attachment[source]
 286 | Attach an attachment to an issue and returns a Resource for it.
 287 | 
 288 | 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.)
 289 | 
 290 | Parameters:
 291 | issue (Union[str, int]) – the issue to attach the attachment to
 292 | 
 293 | attachment (Union[str,BufferedReader]) – file-like object to attach to the issue, also works if it is a string with the filename.
 294 | 
 295 | 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.
 296 | 
 297 | Returns:
 298 | Attachment
 299 | 
 300 | delete_attachment(id: str) → Response[source]
 301 | Delete attachment by id.
 302 | 
 303 | Parameters:
 304 | id (str) – ID of the attachment to delete
 305 | 
 306 | Returns:
 307 | Response
 308 | 
 309 | component(id: str)[source]
 310 | Get a component Resource from the server.
 311 | 
 312 | Parameters:
 313 | id (str) – ID of the component to get
 314 | 
 315 | create_component(name: str, project: str, description=None, leadUserName=None, assigneeType=None, isAssigneeTypeValid=False) → Component[source]
 316 | Create a component inside a project and return a Resource for it.
 317 | 
 318 | Parameters:
 319 | name (str) – name of the component
 320 | 
 321 | project (str) – key of the project to create the component in
 322 | 
 323 | description (str) – a description of the component
 324 | 
 325 | leadUserName (Optional[str]) – the username of the user responsible for this component
 326 | 
 327 | assigneeType (Optional[str]) – see the ComponentBean.AssigneeType class for valid values
 328 | 
 329 | isAssigneeTypeValid (bool) – True specifies whether the assignee type is acceptable (Default: False)
 330 | 
 331 | Returns:
 332 | Component
 333 | 
 334 | component_count_related_issues(id: str)[source]
 335 | Get the count of related issues for a component.
 336 | 
 337 | Parameters:
 338 | id (str) – ID of the component to use
 339 | 
 340 | delete_component(id: str) → Response[source]
 341 | Delete component by id.
 342 | 
 343 | Parameters:
 344 | id (str) – ID of the component to use
 345 | 
 346 | Returns:
 347 | Response
 348 | 
 349 | custom_field_option(id: str) → CustomFieldOption[source]
 350 | Get a custom field option Resource from the server.
 351 | 
 352 | Parameters:
 353 | id (str) – ID of the custom field to use
 354 | 
 355 | Returns:
 356 | CustomFieldOption
 357 | 
 358 | dashboards(filter=None, startAt=0, maxResults=20) → ResultList[Dashboard][source]
 359 | Return a ResultList of Dashboard resources and a total count.
 360 | 
 361 | Parameters:
 362 | filter (Optional[str]) – either “favourite” or “my”, the type of dashboards to return
 363 | 
 364 | startAt (int) – index of the first dashboard to return (Default: 0)
 365 | 
 366 | maxResults (int) – maximum number of dashboards to return. If maxResults set to False, it will try to get all items in batches. (Default: 20)
 367 | 
 368 | Returns:
 369 | ResultList[Dashboard]
 370 | 
 371 | dashboard(id: str) → Dashboard[source]
 372 | Get a dashboard Resource from the server.
 373 | 
 374 | Parameters:
 375 | id (str) – ID of the dashboard to get.
 376 | 
 377 | Returns:
 378 | Dashboard
 379 | 
 380 | create_dashboard(**kwargs)[source]
 381 | copy_dashboard(**kwargs)[source]
 382 | update_dashboard_automatic_refresh_minutes(**kwargs)[source]
 383 | dashboard_item_property_keys(dashboard_id: str, item_id: str) → ResultList[DashboardItemPropertyKey][source]
 384 | Return a ResultList of a Dashboard gadget’s property keys.
 385 | 
 386 | Parameters:
 387 | dashboard_id (str) – ID of dashboard.
 388 | 
 389 | item_id (str) – ID of dashboard item (DashboardGadget).
 390 | 
 391 | Returns:
 392 | ResultList[DashboardItemPropertyKey]
 393 | 
 394 | dashboard_item_property(dashboard_id: str, item_id: str, property_key: str) → DashboardItemProperty[source]
 395 | Get the item property for a specific dashboard item (DashboardGadget).
 396 | 
 397 | Parameters:
 398 | dashboard_id (str) – of the dashboard.
 399 | 
 400 | item_id (str) – ID of the item (DashboardGadget) on the dashboard.
 401 | 
 402 | property_key (str) – KEY of the gadget property.
 403 | 
 404 | Returns:
 405 | DashboardItemProperty
 406 | 
 407 | set_dashboard_item_property(dashboard_id: str, item_id: str, property_key: str, value: dict[str, Any]) → DashboardItemProperty[source]
 408 | Set a dashboard item property.
 409 | 
 410 | Parameters:
 411 | dashboard_id (str) – Dashboard id.
 412 | 
 413 | item_id (str) – ID of dashboard item (DashboardGadget) to add property_key to.
 414 | 
 415 | property_key (str) – The key of the property to set.
 416 | 
 417 | value (dict[str, Any]) – The dictionary containing the value of the property key.
 418 | 
 419 | Returns:
 420 | DashboardItemProperty
 421 | 
 422 | dashboard_gadgets(**kwargs)[source]
 423 | all_dashboard_gadgets(**kwargs)[source]
 424 | add_gadget_to_dashboard(**kwargs)[source]
 425 | fields() → list[dict[str, Any]][source]
 426 | Return a list of all issue fields.
 427 | 
 428 | Returns:
 429 | List[Dict[str, Any]]
 430 | 
 431 | filter(id: str) → Filter[source]
 432 | Get a filter Resource from the server.
 433 | 
 434 | Parameters:
 435 | id (str) – ID of the filter to get.
 436 | 
 437 | Returns:
 438 | Filter
 439 | 
 440 | favourite_filters() → list[Filter][source]
 441 | Get a list of filter Resources which are the favourites of the currently authenticated user.
 442 | 
 443 | Returns:
 444 | List[Filter]
 445 | 
 446 | create_filter(name: str | None = None, description: str | None = None, jql: str | None = None, favourite: bool | None = None) → Filter[source]
 447 | Create a new filter and return a filter Resource for it.
 448 | 
 449 | Parameters:
 450 | name (str) – name of the new filter
 451 | 
 452 | description (str) – Useful human-readable description of the new filter
 453 | 
 454 | jql (str) – query string that defines the filter
 455 | 
 456 | favourite (Optional[bool]) – True adds this filter to the current user’s favorites (Default: None)
 457 | 
 458 | Returns:
 459 | Filter
 460 | 
 461 | update_filter(filter_id, name: str | None = None, description: str | None = None, jql: str | None = None, favourite: bool | None = None)[source]
 462 | Update a filter and return a filter Resource for it.
 463 | 
 464 | Parameters:
 465 | name (Optional[str]) – name of the new filter
 466 | 
 467 | description (Optional[str]) – Useful human-readable description of the new filter
 468 | 
 469 | jql (Optional[str]) – query string that defines the filter
 470 | 
 471 | favourite (Optional[bool]) – True to add this filter to the current user’s favorites (Default: None)
 472 | 
 473 | group(id: str, expand: Any | None = None) → Group[source]
 474 | Get a group Resource from the server.
 475 | 
 476 | Parameters:
 477 | id (str) – ID of the group to get
 478 | 
 479 | expand (Optional[Any]) – Extra information to fetch inside each resource
 480 | 
 481 | Returns:
 482 | Group
 483 | 
 484 | groups(query: str | None = None, exclude: Any | None = None, maxResults: int = 9999) → list[str][source]
 485 | Return a list of groups matching the specified criteria.
 486 | 
 487 | Parameters:
 488 | query (Optional[str]) – filter groups by name with this string
 489 | 
 490 | exclude (Optional[Any]) – filter out groups by name with this string
 491 | 
 492 | maxResults (int) – maximum results to return. (Default: 9999)
 493 | 
 494 | Returns:
 495 | List[str]
 496 | 
 497 | group_members(group: str) → OrderedDict[source]
 498 | Return a hash or users with their information. Requires Jira 6.0 or will raise NotImplemented.
 499 | 
 500 | Parameters:
 501 | group (str) – Name of the group.
 502 | 
 503 | add_group(groupname: str) → bool[source]
 504 | Create a new group in Jira.
 505 | 
 506 | Parameters:
 507 | groupname (str) – The name of the group you wish to create.
 508 | 
 509 | Returns:
 510 | bool – True if successful.
 511 | 
 512 | remove_group(groupname: str) → bool[source]
 513 | Delete a group from the Jira instance.
 514 | 
 515 | Parameters:
 516 | groupname (str) – The group to be deleted from the Jira instance.
 517 | 
 518 | Returns:
 519 | bool – Returns True on success.
 520 | 
 521 | issue(id: Issue | str, fields: str | None = None, expand: str | None = None, properties: str | None = None) → Issue[source]
 522 | Get an issue Resource from the server.
 523 | 
 524 | Parameters:
 525 | id (Union[Issue, str]) – ID or key of the issue to get
 526 | 
 527 | fields (Optional[str]) – comma-separated string of issue fields to include in the results
 528 | 
 529 | expand (Optional[str]) – extra information to fetch inside each resource
 530 | 
 531 | properties (Optional[str]) – extra properties to fetch inside each result
 532 | 
 533 | Returns:
 534 | Issue
 535 | 
 536 | create_issue(fields: dict[str, Any] | None = None, prefetch: bool = True, **fieldargs) → Issue[source]
 537 | Create a new issue and return an issue Resource for it.
 538 | 
 539 | 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.
 540 | 
 541 | 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.
 542 | 
 543 | 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
 544 | 
 545 | Parameters:
 546 | fields (Optional[Dict[str, Any]]) – a dict containing field names and the values to use. If present, all other keyword arguments will be ignored
 547 | 
 548 | prefetch (bool) – True reloads the created issue Resource so all of its data is present in the value returned (Default: True)
 549 | 
 550 | Returns:
 551 | Issue
 552 | 
 553 | create_issues(field_list: list[dict[str, Any]], prefetch: bool = True) → list[dict[str, Any]][source]
 554 | Bulk create new issues and return an issue Resource for each successfully created issue.
 555 | 
 556 | See create_issue documentation for field information.
 557 | 
 558 | Parameters:
 559 | 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.
 560 | 
 561 | prefetch (bool) – True reloads the created issue Resource so all of its data is present in the value returned (Default: True)
 562 | 
 563 | Returns:
 564 | List[Dict[str, Any]]
 565 | 
 566 | supports_service_desk()[source]
 567 | Returns if the Jira instance supports service desk.
 568 | 
 569 | Returns:
 570 | bool
 571 | 
 572 | create_customer(email: str, displayName: str) → Customer[source]
 573 | Create a new customer and return an issue Resource for it.
 574 | 
 575 | Parameters:
 576 | email (str) – Customer Email
 577 | 
 578 | displayName (str) – Customer display name
 579 | 
 580 | Returns:
 581 | Customer
 582 | 
 583 | service_desks() → list[ServiceDesk][source]
 584 | Get a list of ServiceDesk Resources from the server visible to the current authenticated user.
 585 | 
 586 | Returns:
 587 | List[ServiceDesk]
 588 | 
 589 | service_desk(id: str) → ServiceDesk[source]
 590 | Get a Service Desk Resource from the server.
 591 | 
 592 | Parameters:
 593 | id (str) – ID or key of the Service Desk to get
 594 | 
 595 | Returns:
 596 | ServiceDesk
 597 | 
 598 | create_customer_request(fields: dict[str, Any] | None = None, prefetch: bool = True, **fieldargs) → Issue[source]
 599 | Create a new customer request and return an issue Resource for it.
 600 | 
 601 | 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.
 602 | 
 603 | 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.
 604 | 
 605 | 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
 606 | 
 607 | Parameters:
 608 | fields (Dict[str, Any]) – a dict containing field names and the values to use. If present, all other keyword arguments will be ignored
 609 | 
 610 | prefetch (bool) – True reloads the created issue Resource so all of its data is present in the value returned (Default: True)
 611 | 
 612 | Returns:
 613 | Issue
 614 | 
 615 | createmeta_issuetypes(projectIdOrKey: str | int, startAt: int = 0, maxResults: int = 50) → dict[str, Any][source]
 616 | Get the issue types metadata for a given project, required to create issues.
 617 | 
 618 | Deprecated since version 3.6.0: Use project_issue_types() instead.
 619 | 
 620 | 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
 621 | 
 622 | Parameters:
 623 | projectIdOrKey (Union[str, int]) – id or key of the project for which to get the metadata.
 624 | 
 625 | startAt (int) – Index of the first issue to return. (Default: 0)
 626 | 
 627 | maxResults (int) – Maximum number of issues to return. Total number of results is available in the total attribute of the returned ResultList. If maxResults evaluates to False, it will try to get all issues in batches. (Default: 50)
 628 | 
 629 | Returns:
 630 | Dict[str, Any]
 631 | 
 632 | createmeta_fieldtypes(projectIdOrKey: str | int, issueTypeId: str | int, startAt: int = 0, maxResults: int = 50) → dict[str, Any][source]
 633 | Get the field metadata for a given project and issue type, required to create issues.
 634 | 
 635 | Deprecated since version 3.6.0: Use project_issue_fields() instead.
 636 | 
 637 | 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
 638 | 
 639 | Parameters:
 640 | projectIdOrKey (Union[str, int]) – id or key of the project for which to get the metadata.
 641 | 
 642 | issueTypeId (Union[str, int]) – id of the issue type for which to get the metadata.
 643 | 
 644 | startAt (int) – Index of the first issue to return. (Default: 0)
 645 | 
 646 | maxResults (int) – Maximum number of issues to return. Total number of results is available in the total attribute of the returned ResultList. If maxResults evaluates to False, it will try to get all issues in batches. (Default: 50)
 647 | 
 648 | Returns:
 649 | Dict[str, Any]
 650 | 
 651 | createmeta(projectKeys: tuple[str, str] | str | None = None, projectIds: list | tuple[str, str] = [], issuetypeIds: list[str] | None = None, issuetypeNames: str | None = None, expand: str | None = None) → dict[str, Any][source]
 652 | Get the metadata required to create issues, optionally filtered by projects and issue types.
 653 | 
 654 | Parameters:
 655 | 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.
 656 | 
 657 | 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.
 658 | 
 659 | 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.
 660 | 
 661 | 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.
 662 | 
 663 | expand (Optional[str]) – extra information to fetch inside each resource.
 664 | 
 665 | Returns:
 666 | Dict[str, Any]
 667 | 
 668 | assign_issue(issue: int | str, assignee: str | None) → bool[source]
 669 | Assign an issue to a user.
 670 | 
 671 | Parameters:
 672 | issue (Union[int, str]) – the issue ID or key to assign
 673 | 
 674 | assignee (str) – the user to assign the issue to. None will set it to unassigned. -1 will set it to Automatic.
 675 | 
 676 | Returns:
 677 | bool
 678 | 
 679 | comments(issue: int | str, expand: str | None = None) → list[Comment][source]
 680 | Get a list of comment Resources of the issue provided.
 681 | 
 682 | Parameters:
 683 | issue (Union[int, str]) – the issue ID or key to get the comments from
 684 | 
 685 | expand (Optional[str]) – extra information to fetch for each comment such as renderedBody and properties.
 686 | 
 687 | Returns:
 688 | List[Comment]
 689 | 
 690 | comment(issue: int | str, comment: str, expand: str | None = None) → Comment[source]
 691 | Get a comment Resource from the server for the specified ID.
 692 | 
 693 | Parameters:
 694 | issue (Union[int, str]) – the issue ID or key to get the comment from
 695 | 
 696 | comment (str) – ID of the comment to get
 697 | 
 698 | expand (Optional[str]) – extra information to fetch for each comment such as renderedBody and properties.
 699 | 
 700 | Returns:
 701 | Comment
 702 | 
 703 | add_comment(issue: str | int | Issue, body: str, visibility: dict[str, str] | None = None, is_internal: bool = False) → Comment[source]
 704 | Add a comment from the current authenticated user on the specified issue and return a Resource for it.
 705 | 
 706 | Parameters:
 707 | issue (Union[str, int, jira.resources.Issue]) – ID or key of the issue to add the comment to
 708 | 
 709 | body (str) – Text of the comment to add
 710 | 
 711 | 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.
 712 | 
 713 | is_internal (bool) – True marks the comment as ‘Internal’ in Jira Service Desk (Default: False)
 714 | 
 715 | Returns:
 716 | Comment – the created comment
 717 | 
 718 | editmeta(issue: str | int)[source]
 719 | Get the edit metadata for an issue.
 720 | 
 721 | Parameters:
 722 | issue (Union[str, int]) – the issue to get metadata for
 723 | 
 724 | Returns:
 725 | Dict[str, Dict[str, Dict[str, Any]]]
 726 | 
 727 | remote_links(issue: str | int) → list[RemoteLink][source]
 728 | Get a list of remote link Resources from an issue.
 729 | 
 730 | Parameters:
 731 | issue (Union[str, int]) – the issue to get remote links from
 732 | 
 733 | Returns:
 734 | List[RemoteLink]
 735 | 
 736 | remote_link(issue: str | int, id: str) → RemoteLink[source]
 737 | Get a remote link Resource from the server.
 738 | 
 739 | Parameters:
 740 | issue (Union[str, int]) – the issue holding the remote link
 741 | 
 742 | id (str) – ID of the remote link
 743 | 
 744 | Returns:
 745 | RemoteLink
 746 | 
 747 | add_remote_link(issue: str, destination: Issue | dict[str, Any], globalId: str | None = None, application: dict[str, Any] | None = None, relationship: str | None = None) → RemoteLink[source]
 748 | Add a remote link from an issue to an external application and returns a remote link Resource for it.
 749 | 
 750 | destination should be a dict containing at least url to the linked external URL and title to display for the link inside Jira.
 751 | 
 752 | 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.
 753 | 
 754 | Parameters:
 755 | issue (str) – the issue to add the remote link to
 756 | 
 757 | destination (Union[Issue, Dict[str, Any]]) – the link details to add (see the above link for details)
 758 | 
 759 | globalId (Optional[str]) – unique ID for the link (see the above link for details)
 760 | 
 761 | application (Optional[Dict[str,Any]]) – application information for the link (see the above link for details)
 762 | 
 763 | relationship (Optional[str]) – relationship description for the link (see the above link for details)
 764 | 
 765 | Returns:
 766 | RemoteLink – the added remote link
 767 | 
 768 | add_simple_link(issue: str, object: dict[str, Any])[source]
 769 | Add a simple remote link from an issue to web resource.
 770 | 
 771 | 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.
 772 | 
 773 | object should be a dict containing at least url to the linked external URL and title to display for the link inside Jira
 774 | 
 775 | For definitions of the allowable fields for object , see https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+for+Remote+Issue+Links.
 776 | 
 777 | Parameters:
 778 | issue (str) – the issue to add the remote link to
 779 | 
 780 | object (Dict[str,Any]) – the dictionary used to create remotelink data
 781 | 
 782 | Returns:
 783 | RemoteLink
 784 | 
 785 | transitions(issue: str | int | Issue, id: str | None = None, expand=None)[source]
 786 | Get a list of the transitions available on the specified issue to the current user.
 787 | 
 788 | Parameters:
 789 | issue (Union[str, int, jira.resources.Issue]) – ID or key of the issue to get the transitions from
 790 | 
 791 | id (Optional[str]) – if present, get only the transition matching this ID
 792 | 
 793 | expand (Optional) – extra information to fetch inside each transition
 794 | 
 795 | Returns:
 796 | Any – json of response
 797 | 
 798 | find_transitionid_by_name(issue: str | int | Issue, transition_name: str) → int | None[source]
 799 | Get a transitionid available on the specified issue to the current user.
 800 | 
 801 | Look at https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1074 for json reference
 802 | 
 803 | Parameters:
 804 | issue (Union[str, int, jira.resources.Issue]) – ID or key of the issue to get the transitions from
 805 | 
 806 | transition_name (str) – name of transition we are looking for
 807 | 
 808 | Returns:
 809 | Optional[int] – returns the id is found None when it’s not
 810 | 
 811 | transition_issue(issue: str | int | Issue, transition: str, fields: dict[str, Any] | None = None, comment: str | None = None, worklog: str | None = None, **fieldargs)[source]
 812 | Perform a transition on an issue.
 813 | 
 814 | 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.
 815 | 
 816 | Parameters:
 817 | issue (Union[str, int, jira.resources.Issue]) – ID or key of the issue to perform the transition on
 818 | 
 819 | transition (str) – ID or name of the transition to perform
 820 | 
 821 | fields (Optional[Dict[str,Any]]) – a dict containing field names and the values to use.
 822 | 
 823 | comment (Optional[str]) – String to add as comment to the issue when performing the transition.
 824 | 
 825 | worklog (Optional[str]) – String to add as time spent on the issue when performing the transition.
 826 | 
 827 | **fieldargs – If present, all other keyword arguments will be ignored
 828 | 
 829 | votes(issue: str | int) → Votes[source]
 830 | Get a votes Resource from the server.
 831 | 
 832 | Parameters:
 833 | issue (Union[str, int]) – ID or key of the issue to get the votes for
 834 | 
 835 | Returns:
 836 | Votes
 837 | 
 838 | project_issue_security_level_scheme(project: str) → IssueSecurityLevelScheme[source]
 839 | Get a IssueSecurityLevelScheme Resource from the server.
 840 | 
 841 | Parameters:
 842 | project (str) – ID or key of the project to get the IssueSecurityLevelScheme for
 843 | 
 844 | Returns:
 845 | IssueSecurityLevelScheme – The issue security level scheme
 846 | 
 847 | project_notification_scheme(project: str) → NotificationScheme[source]
 848 | Get a NotificationScheme Resource from the server.
 849 | 
 850 | Parameters:
 851 | project (str) – ID or key of the project to get the NotificationScheme for
 852 | 
 853 | Returns:
 854 | NotificationScheme – The notification scheme
 855 | 
 856 | project_permissionscheme(project: str) → PermissionScheme[source]
 857 | Get a PermissionScheme Resource from the server.
 858 | 
 859 | Parameters:
 860 | project (str) – ID or key of the project to get the permissionscheme for
 861 | 
 862 | Returns:
 863 | PermissionScheme – The permission scheme
 864 | 
 865 | project_priority_scheme(project: str) → PriorityScheme[source]
 866 | Get a PriorityScheme Resource from the server.
 867 | 
 868 | Parameters:
 869 | project (str) – ID or key of the project to get the PriorityScheme for
 870 | 
 871 | Returns:
 872 | PriorityScheme – The priority scheme
 873 | 
 874 | project_workflow_scheme(project: str) → WorkflowScheme[source]
 875 | Get a WorkflowScheme Resource from the server.
 876 | 
 877 | Parameters:
 878 | project (str) – ID or key of the project to get the WorkflowScheme for
 879 | 
 880 | Returns:
 881 | WorkflowScheme – The workflow scheme
 882 | 
 883 | add_vote(issue: str | int) → Response[source]
 884 | Register a vote for the current authenticated user on an issue.
 885 | 
 886 | Parameters:
 887 | issue (Union[str, int]) – ID or key of the issue to vote on
 888 | 
 889 | Returns:
 890 | Response
 891 | 
 892 | remove_vote(issue: str | int)[source]
 893 | Remove the current authenticated user’s vote from an issue.
 894 | 
 895 | Parameters:
 896 | issue (Union[str, int]) – ID or key of the issue to remove vote on
 897 | 
 898 | watchers(issue: str | int) → Watchers[source]
 899 | Get a watchers Resource from the server for an issue.
 900 | 
 901 | Parameters:
 902 | issue (Union[str, int]) – ID or key of the issue to get the watchers for
 903 | 
 904 | Returns:
 905 | Watchers
 906 | 
 907 | add_watcher(issue: str | int, watcher: str) → Response[source]
 908 | Add a user to an issue’s watchers list.
 909 | 
 910 | Parameters:
 911 | issue (Union[str, int]) – ID or key of the issue affected
 912 | 
 913 | watcher (str) – name of the user to add to the watchers list
 914 | 
 915 | Returns:
 916 | Response
 917 | 
 918 | remove_watcher(issue: str | int, watcher: str) → Response[source]
 919 | Remove a user from an issue’s watch list.
 920 | 
 921 | Parameters:
 922 | issue (Union[str, int]) – ID or key of the issue affected
 923 | 
 924 | watcher (str) – name of the user to remove from the watchers list
 925 | 
 926 | Returns:
 927 | Response
 928 | 
 929 | worklogs(issue: str | int) → list[Worklog][source]
 930 | Get a list of worklog Resources from the server for an issue.
 931 | 
 932 | Parameters:
 933 | issue (Union[str, int]) – ID or key of the issue to get worklogs from
 934 | 
 935 | Returns:
 936 | List[Worklog]
 937 | 
 938 | worklog(issue: str | int, id: str) → Worklog[source]
 939 | Get a specific worklog Resource from the server.
 940 | 
 941 | Parameters:
 942 | issue (Union[str, int]) – ID or key of the issue to get the worklog from
 943 | 
 944 | id (str) – ID of the worklog to get
 945 | 
 946 | Returns:
 947 | Worklog
 948 | 
 949 | add_worklog(issue: str | int, timeSpent: str | None = None, timeSpentSeconds: str | None = None, adjustEstimate: str | None = None, newEstimate: str | None = None, reduceBy: str | None = None, comment: str | None = None, started: datetime | None = None, user: str | None = None, visibility: dict[str, Any] | None = None) → Worklog[source]
 950 | Add a new worklog entry on an issue and return a Resource for it.
 951 | 
 952 | Parameters:
 953 | issue (Union[str, int]) – the issue to add the worklog to
 954 | 
 955 | timeSpent (Optional[str]) – a worklog entry with this amount of time spent, e.g. “2d”
 956 | 
 957 | timeSpentSeconds (Optional[str]) – a worklog entry with this amount of time spent in seconds
 958 | 
 959 | 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).
 960 | 
 961 | newEstimate (Optional[str]) – the new value for the remaining estimate field. e.g. “2d”
 962 | 
 963 | reduceBy (Optional[str]) – the amount to reduce the remaining estimate by e.g. “2d”
 964 | 
 965 | comment (Optional[str]) – optional worklog comment
 966 | 
 967 | started (Optional[datetime.datetime]) – Moment when the work is logged, if not specified will default to now
 968 | 
 969 | user (Optional[str]) – the user ID or name to use for this worklog
 970 | 
 971 | visibility (Optional[Dict[str,Any]]) – Details about any restrictions in the visibility of the worklog. Example of visibility options when creating or updating a worklog. { "type": "group", "value": "<string>", "identifier": "<string>"}
 972 | 
 973 | Returns:
 974 | Worklog
 975 | 
 976 | issue_properties(issue: str) → list[IssueProperty][source]
 977 | Get a list of issue property Resource from the server for an issue.
 978 | 
 979 | Parameters:
 980 | issue (str) – ID or key of the issue to get properties from
 981 | 
 982 | Returns:
 983 | List[IssueProperty]
 984 | 
 985 | issue_property(issue: str, key: str) → IssueProperty[source]
 986 | Get a specific issue property Resource from the server.
 987 | 
 988 | Parameters:
 989 | issue (str) – ID or key of the issue to get the property from
 990 | 
 991 | key (str) – Key of the property to get
 992 | 
 993 | Returns:
 994 | IssueProperty
 995 | 
 996 | add_issue_property(issue: str, key: str, data) → Response[source]
 997 | Add or update a specific issue property Resource.
 998 | 
 999 | Parameters:
1000 | issue (str) – ID or key of the issue to set the property to
1001 | 
1002 | key (str) – Key of the property to set
1003 | 
1004 | data – The data to set for the property
1005 | 
1006 | Returns:
1007 | Response
1008 | 
1009 | create_issue_link(type: str | IssueLinkType, inwardIssue: str, outwardIssue: str, comment: dict[str, Any] | None = None) → Response[source]
1010 | Create a link between two issues.
1011 | 
1012 | Parameters:
1013 | type (Union[str,IssueLinkType]) – the type of link to create
1014 | 
1015 | inwardIssue – the issue to link from
1016 | 
1017 | outwardIssue – the issue to link to
1018 | 
1019 | 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.
1020 | 
1021 | Returns:
1022 | Response
1023 | 
1024 | delete_issue_link(id: str)[source]
1025 | Delete a link between two issues.
1026 | 
1027 | Parameters:
1028 | id (str) – ID of the issue link to delete
1029 | 
1030 | issue_link(id: str) → IssueLink[source]
1031 | Get an issue link Resource from the server.
1032 | 
1033 | Parameters:
1034 | id (str) – ID of the issue link to get
1035 | 
1036 | Returns:
1037 | IssueLink
1038 | 
1039 | issue_link_types(force: bool = False) → list[IssueLinkType][source]
1040 | Get a list of issue link type Resources from the server.
1041 | 
1042 | Parameters:
1043 | force (bool) – True forces an update of the cached IssueLinkTypes. (Default: False)
1044 | 
1045 | Returns:
1046 | List[IssueLinkType]
1047 | 
1048 | issue_link_type(id: str) → IssueLinkType[source]
1049 | Get an issue link type Resource from the server.
1050 | 
1051 | Parameters:
1052 | id (str) – ID of the issue link type to get
1053 | 
1054 | Returns:
1055 | IssueLinkType
1056 | 
1057 | issue_types() → list[IssueType][source]
1058 | Get a list of issue type Resources from the server.
1059 | 
1060 | Returns:
1061 | List[IssueType]
1062 | 
1063 | project_issue_types(project: str, startAt: int = 0, maxResults: int = 50) → ResultList[IssueType][source]
1064 | Get a list of issue type Resources available in a given project from the server.
1065 | 
1066 | 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
1067 | 
1068 | Parameters:
1069 | project (str) – ID or key of the project to query issue types from.
1070 | 
1071 | startAt (int) – Index of first issue type to return. (Default: 0)
1072 | 
1073 | maxResults (int) – Maximum number of issue types to return. (Default: 50)
1074 | 
1075 | Returns:
1076 | ResultList[IssueType]
1077 | 
1078 | project_issue_fields(project: str, issue_type: str, startAt: int = 0, maxResults: int = 50) → ResultList[Field][source]
1079 | Get a list of field type Resources available for a project and issue type from the server.
1080 | 
1081 | 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
1082 | 
1083 | Parameters:
1084 | project (str) – ID or key of the project to query field types from.
1085 | 
1086 | issue_type (str) – ID of the issue type to query field types from.
1087 | 
1088 | startAt (int) – Index of first issue type to return. (Default: 0)
1089 | 
1090 | maxResults (int) – Maximum number of issue types to return. (Default: 50)
1091 | 
1092 | Returns:
1093 | ResultList[Field]
1094 | 
1095 | issue_type(id: str) → IssueType[source]
1096 | Get an issue type Resource from the server.
1097 | 
1098 | Parameters:
1099 | id (str) – ID of the issue type to get
1100 | 
1101 | Returns:
1102 | IssueType
1103 | 
1104 | issue_type_by_name(name: str, project: str | None = None) → IssueType[source]
1105 | Get issue type by name.
1106 | 
1107 | Parameters:
1108 | name (str) – Name of the issue type
1109 | 
1110 | project (str) – Key or ID of the project. If set, only issue types available for that project will be looked up.
1111 | 
1112 | Returns:
1113 | IssueType
1114 | 
1115 | request_types(service_desk: ServiceDesk) → list[RequestType][source]
1116 | Returns request types supported by a service desk instance.
1117 | 
1118 | Parameters:
1119 | service_desk (ServiceDesk) – The service desk instance.
1120 | 
1121 | Returns:
1122 | List[RequestType]
1123 | 
1124 | request_type_by_name(service_desk: ServiceDesk, name: str)[source]
1125 | my_permissions(projectKey: str | None = None, projectId: str | None = None, issueKey: str | None = None, issueId: str | None = None, permissions: str | None = None) → dict[str, dict[str, dict[str, str]]][source]
1126 | Get a dict of all available permissions on the server.
1127 | 
1128 | 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
1129 | 
1130 | Parameters:
1131 | projectKey (Optional[str]) – limit returned permissions to the specified project
1132 | 
1133 | projectId (Optional[str]) – limit returned permissions to the specified project
1134 | 
1135 | issueKey (Optional[str]) – limit returned permissions to the specified issue
1136 | 
1137 | issueId (Optional[str]) – limit returned permissions to the specified issue
1138 | 
1139 | permissions (Optional[str]) – limit returned permissions to the specified csv permission keys (cloud required field)
1140 | 
1141 | Returns:
1142 | Dict[str, Dict[str, Dict[str, str]]]
1143 | 
1144 | priorities() → list[Priority][source]
1145 | Get a list of priority Resources from the server.
1146 | 
1147 | Returns:
1148 | List[Priority]
1149 | 
1150 | priority(id: str) → Priority[source]
1151 | Get a priority Resource from the server.
1152 | 
1153 | Parameters:
1154 | id (str) – ID of the priority to get
1155 | 
1156 | Returns:
1157 | Priority
1158 | 
1159 | projects(expand: str | None = None) → list[Project][source]
1160 | Get a list of project Resources from the server visible to the current authenticated user.
1161 | 
1162 | Parameters:
1163 | expand (Optional[str]) – extra information to fetch for each project such as projectKeys and description.
1164 | 
1165 | Returns:
1166 | List[Project]
1167 | 
1168 | project(id: str, expand: str | None = None) → Project[source]
1169 | Get a project Resource from the server.
1170 | 
1171 | Parameters:
1172 | id (str) – ID or key of the project to get
1173 | 
1174 | expand (Optional[str]) – extra information to fetch for the project such as projectKeys and description.
1175 | 
1176 | Returns:
1177 | Project
1178 | 
1179 | project_avatars(project: str)[source]
1180 | Get a dict of all avatars for a project visible to the current authenticated user.
1181 | 
1182 | Parameters:
1183 | project (str) – ID or key of the project to get avatars for
1184 | 
1185 | create_temp_project_avatar(project: str, filename: str, size: int, avatar_img: bytes, contentType: str | None = None, auto_confirm: bool = False)[source]
1186 | Register an image file as a project avatar.
1187 | 
1188 | The avatar created is temporary and must be confirmed before it can be used.
1189 | 
1190 | 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 for details on how to install support).
1191 | 
1192 | 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.)
1193 | 
1194 | 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 confirm_project_avatar() to finish the avatar creation process. If you want to confirm the avatar with Jira’s default cropping, pass the ‘auto_confirm’ argument with a truthy value and confirm_project_avatar() will be called for you before this method returns.
1195 | 
1196 | Parameters:
1197 | project (str) – ID or key of the project to create the avatar in
1198 | 
1199 | filename (str) – name of the avatar file
1200 | 
1201 | size (int) – size of the avatar file
1202 | 
1203 | avatar_img (bytes) – file-like object holding the avatar
1204 | 
1205 | contentType (str) – explicit specification for the avatar image’s content-type
1206 | 
1207 | auto_confirm (bool) – True to automatically confirm the temporary avatar by calling confirm_project_avatar() with the return value of this method. (Default: False)
1208 | 
1209 | confirm_project_avatar(project: str, cropping_properties: dict[str, Any])[source]
1210 | Confirm the temporary avatar image previously uploaded with the specified cropping.
1211 | 
1212 | After a successful registry with 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 create_temp_project_avatar() should be used for this argument.
1213 | 
1214 | Parameters:
1215 | project (str) – ID or key of the project to confirm the avatar in
1216 | 
1217 | cropping_properties (Dict[str,Any]) – a dict of cropping properties from create_temp_project_avatar()
1218 | 
1219 | set_project_avatar(project: str, avatar: str)[source]
1220 | Set a project’s avatar.
1221 | 
1222 | Parameters:
1223 | project (str) – ID or key of the project to set the avatar on
1224 | 
1225 | avatar (str) – ID of the avatar to set
1226 | 
1227 | delete_project_avatar(project: str, avatar: str) → Response[source]
1228 | Delete a project’s avatar.
1229 | 
1230 | Parameters:
1231 | project (str) – ID or key of the project to delete the avatar from
1232 | 
1233 | avatar (str) – ID of the avatar to delete
1234 | 
1235 | Returns:
1236 | Response
1237 | 
1238 | project_components(project: str) → list[Component][source]
1239 | Get a list of component Resources present on a project.
1240 | 
1241 | Parameters:
1242 | project (str) – ID or key of the project to get components from
1243 | 
1244 | Returns:
1245 | List[Component]
1246 | 
1247 | project_versions(project: str) → list[Version][source]
1248 | Get a list of version Resources present on a project.
1249 | 
1250 | Parameters:
1251 | project (str) – ID or key of the project to get versions from
1252 | 
1253 | Returns:
1254 | List[Version]
1255 | 
1256 | get_project_version_by_name(project: str, version_name: str) → Version | None[source]
1257 | Get a version Resource by its name present on a project.
1258 | 
1259 | Parameters:
1260 | project (str) – ID or key of the project to get versions from
1261 | 
1262 | version_name (str) – name of the version to search for
1263 | 
1264 | Returns:
1265 | Optional[Version]
1266 | 
1267 | rename_version(project: str, old_name: str, new_name: str) → None[source]
1268 | Rename a version Resource on a project.
1269 | 
1270 | Parameters:
1271 | project (str) – ID or key of the project to get versions from
1272 | 
1273 | old_name (str) – old name of the version to rename
1274 | 
1275 | new_name (str) – new name of the version to rename
1276 | 
1277 | project_roles(project: str) → dict[str, dict[str, str]][source]
1278 | Get a dict of role names to resource locations for a project.
1279 | 
1280 | Parameters:
1281 | project (str) – ID or key of the project to get roles from
1282 | 
1283 | Returns:
1284 | Dict[str, Dict[str, str]]
1285 | 
1286 | project_role(project: str, id: str) → Role[source]
1287 | Get a role Resource.
1288 | 
1289 | Parameters:
1290 | project (str) – ID or key of the project to get the role from
1291 | 
1292 | id (str) – ID of the role to get
1293 | 
1294 | Returns:
1295 | Role
1296 | 
1297 | resolutions() → list[Resolution][source]
1298 | Get a list of resolution Resources from the server.
1299 | 
1300 | Returns:
1301 | List[Resolution]
1302 | 
1303 | resolution(id: str) → Resolution[source]
1304 | Get a resolution Resource from the server.
1305 | 
1306 | Parameters:
1307 | id (str) – ID of the resolution to get
1308 | 
1309 | Returns:
1310 | Resolution
1311 | 
1312 | search_issues(jql_str: str, startAt: int = 0, maxResults: int = 50, validate_query: bool = True, fields: str | list[str] | None = '*all', expand: str | None = None, properties: str | None = None, *, json_result: Literal[False] = False, use_post: bool = False) → ResultList[Issue][source]
1313 | search_issues(jql_str: str, startAt: int = 0, maxResults: int = 50, validate_query: bool = True, fields: str | list[str] | None = '*all', expand: str | None = None, properties: str | None = None, *, json_result: Literal[True], use_post: bool = False) → dict[str, Any]
1314 | Get a ResultList of issue Resources matching a JQL search string.
1315 | 
1316 | Parameters:
1317 | jql_str (str) – The JQL search string.
1318 | 
1319 | startAt (int) – Index of the first issue to return. (Default: 0)
1320 | 
1321 | maxResults (int) – Maximum number of issues to return. Total number of results is available in the total attribute of the returned ResultList. If maxResults evaluates to False, it will try to get all issues in batches. (Default: 50)
1322 | 
1323 | validate_query (bool) – True to validate the query. (Default: True)
1324 | 
1325 | 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.
1326 | 
1327 | expand (Optional[str]) – extra information to fetch inside each resource
1328 | 
1329 | properties (Optional[str]) – extra properties to fetch inside each result
1330 | 
1331 | json_result (bool) – True to return a JSON response. When set to False a ResultList will be returned. (Default: False)
1332 | 
1333 | use_post (bool) – True to use POST endpoint to fetch issues.
1334 | 
1335 | Returns:
1336 | Union[Dict,ResultList] – Dict if json_result=True
1337 | 
1338 | security_level(id: str) → SecurityLevel[source]
1339 | Get a security level Resource.
1340 | 
1341 | Parameters:
1342 | id (str) – ID of the security level to get
1343 | 
1344 | Returns:
1345 | SecurityLevel
1346 | 
1347 | server_info() → dict[str, Any][source]
1348 | Get a dict of server information for this Jira instance.
1349 | 
1350 | Returns:
1351 | Dict[str, Any]
1352 | 
1353 | myself() → dict[str, Any][source]
1354 | Get a dict of server information for this Jira instance.
1355 | 
1356 | Returns:
1357 | Dict[str, Any]
1358 | 
1359 | statuses() → list[Status][source]
1360 | Get a list of all status Resources from the server.
1361 | 
1362 | Refer to JIRA.issue_types_for_project() for getting statuses for a specific issue type within a specific project.
1363 | 
1364 | Returns:
1365 | List[Status]
1366 | 
1367 | issue_types_for_project(projectIdOrKey: str) → list[IssueType][source]
1368 | Get a list of issue types available within the project.
1369 | 
1370 | 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
1371 | 
1372 | Returns:
1373 | List[IssueType]
1374 | 
1375 | status(id: str) → Status[source]
1376 | Get a status Resource from the server.
1377 | 
1378 | Parameters:
1379 | id (str) – ID of the status resource to get
1380 | 
1381 | Returns:
1382 | Status
1383 | 
1384 | statuscategories() → list[StatusCategory][source]
1385 | Get a list of status category Resources from the server.
1386 | 
1387 | Returns:
1388 | List[StatusCategory]
1389 | 
1390 | statuscategory(id: int) → StatusCategory[source]
1391 | Get a status category Resource from the server.
1392 | 
1393 | Parameters:
1394 | id (int) – ID of the status category resource to get
1395 | 
1396 | Returns:
1397 | StatusCategory
1398 | 
1399 | user(id: str, expand: Any | None = None) → User[source]
1400 | Get a user Resource from the server.
1401 | 
1402 | Parameters:
1403 | id (str) – ID of the user to get
1404 | 
1405 | expand (Optional[Any]) – Extra information to fetch inside each resource
1406 | 
1407 | Returns:
1408 | User
1409 | 
1410 | search_assignable_users_for_projects(username: str, projectKeys: str, startAt: int = 0, maxResults: int = 50) → ResultList[source]
1411 | Get a list of user Resources that match the search string and can be assigned issues for projects.
1412 | 
1413 | Parameters:
1414 | username (str) – A string to match usernames against
1415 | 
1416 | projectKeys (str) – Comma-separated list of project keys to check for issue assignment permissions
1417 | 
1418 | startAt (int) – Index of the first user to return (Default: 0)
1419 | 
1420 | maxResults (int) – Maximum number of users to return. If maxResults evaluates as False, it will try to get all users in batches. (Default: 50)
1421 | 
1422 | Returns:
1423 | ResultList
1424 | 
1425 | search_assignable_users_for_issues(username: str | None = None, project: str | None = None, issueKey: str | None = None, expand: Any | None = None, startAt: int = 0, maxResults: int = 50, query: str | None = None)[source]
1426 | Get a list of user Resources that match the search string for assigning or creating issues.
1427 | 
1428 | “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.
1429 | 
1430 | 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.
1431 | 
1432 | Parameters:
1433 | username (Optional[str]) – A string to match usernames against
1434 | 
1435 | project (Optional[str]) – Filter returned users by permission in this project (expected if a result will be used to create an issue)
1436 | 
1437 | issueKey (Optional[str]) – Filter returned users by this issue (expected if a result will be used to edit this issue)
1438 | 
1439 | expand (Optional[Any]) – Extra information to fetch inside each resource
1440 | 
1441 | startAt (int) – Index of the first user to return (Default: 0)
1442 | 
1443 | maxResults (int) – maximum number of users to return. If maxResults evaluates as False, it will try to get all items in batches. (Default: 50)
1444 | 
1445 | query (Optional[str]) – Search term. It can just be the email.
1446 | 
1447 | Returns:
1448 | ResultList
1449 | 
1450 | user_avatars(username: str) → dict[str, Any][source]
1451 | Get a dict of avatars for the specified user.
1452 | 
1453 | Parameters:
1454 | username (str) – the username to get avatars for
1455 | 
1456 | Returns:
1457 | Dict[str, Any]
1458 | 
1459 | create_temp_user_avatar(user: str, filename: str, size: int, avatar_img: bytes, contentType: Any | None = None, auto_confirm: bool = False)[source]
1460 | Register an image file as a user avatar.
1461 | 
1462 | The avatar created is temporary and must be confirmed before it can be used.
1463 | 
1464 | 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 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.)
1465 | 
1466 | 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 confirm_user_avatar() to finish the avatar creation process. If you want to confirm the avatar with Jira’s default cropping, pass the auto_confirm argument with a truthy value and confirm_user_avatar() will be called for you before this method returns.
1467 | 
1468 | Parameters:
1469 | user (str) – User to register the avatar for
1470 | 
1471 | filename (str) – name of the avatar file
1472 | 
1473 | size (int) – size of the avatar file
1474 | 
1475 | avatar_img (bytes) – file-like object containing the avatar
1476 | 
1477 | contentType (Optional[Any]) – explicit specification for the avatar image’s content-type
1478 | 
1479 | auto_confirm (bool) – True to automatically confirm the temporary avatar by calling confirm_user_avatar() with the return value of this method. (Default: False)
1480 | 
1481 | confirm_user_avatar(user: str, cropping_properties: dict[str, Any])[source]
1482 | Confirm the temporary avatar image previously uploaded with the specified cropping.
1483 | 
1484 | After a successful registry with 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 create_temp_user_avatar() should be used for this argument.
1485 | 
1486 | Parameters:
1487 | user (str) – the user to confirm the avatar for
1488 | 
1489 | cropping_properties (Dict[str,Any]) – a dict of cropping properties from create_temp_user_avatar()
1490 | 
1491 | set_user_avatar(username: str, avatar: str) → Response[source]
1492 | Set a user’s avatar.
1493 | 
1494 | Parameters:
1495 | username (str) – the user to set the avatar for
1496 | 
1497 | avatar (str) – ID of the avatar to set
1498 | 
1499 | Returns:
1500 | Response
1501 | 
1502 | delete_user_avatar(username: str, avatar: str) → Response[source]
1503 | Delete a user’s avatar.
1504 | 
1505 | Parameters:
1506 | username (str) – the user to delete the avatar from
1507 | 
1508 | avatar (str) – ID of the avatar to remove
1509 | 
1510 | Returns:
1511 | Response
1512 | 
1513 | delete_remote_link(issue: str | Issue, *, internal_id: str | None = None, global_id: str | None = None) → Response[source]
1514 | Delete remote link from issue by internalId or globalId.
1515 | 
1516 | Parameters:
1517 | issue (str) – Key (or Issue) of Issue
1518 | 
1519 | internal_id (Optional[str]) – InternalID of the remote link to delete
1520 | 
1521 | global_id (Optional[str]) – GlobalID of the remote link to delete
1522 | 
1523 | Returns:
1524 | Response
1525 | 
1526 | search_users(user: str | None = None, startAt: int = 0, maxResults: int = 50, includeActive: bool = True, includeInactive: bool = False, query: str | None = None) → ResultList[User][source]
1527 | Get a list of user Resources that match the specified search string.
1528 | 
1529 | “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.
1530 | 
1531 | Parameters:
1532 | user (Optional[str]) – a string to match usernames, name or email against.
1533 | 
1534 | startAt (int) – index of the first user to return.
1535 | 
1536 | maxResults (int) – maximum number of users to return. If maxResults evaluates as False, it will try to get all items in batches.
1537 | 
1538 | includeActive (bool) – True to include active users in the results. (Default: True)
1539 | 
1540 | includeInactive (bool) – True to include inactive users in the results. (Default: False)
1541 | 
1542 | query (Optional[str]) – Search term. It can just be the email.
1543 | 
1544 | Returns:
1545 | ResultList[User]
1546 | 
1547 | search_allowed_users_for_issue(user: str, issueKey: str | None = None, projectKey: str | None = None, startAt: int = 0, maxResults: int = 50) → ResultList[source]
1548 | Get a list of user Resources that match a username string and have browse permission for the issue or project.
1549 | 
1550 | Parameters:
1551 | user (str) – a string to match usernames against.
1552 | 
1553 | issueKey (Optional[str]) – find users with browse permission for this issue.
1554 | 
1555 | projectKey (Optional[str]) – find users with browse permission for this project.
1556 | 
1557 | startAt (int) – index of the first user to return. (Default: 0)
1558 | 
1559 | maxResults (int) – maximum number of users to return. If maxResults evaluates as False, it will try to get all items in batches. (Default: 50)
1560 | 
1561 | Returns:
1562 | ResultList
1563 | 
1564 | create_version(name: str, project: str, description: str | None = None, releaseDate: Any | None = None, startDate: Any | None = None, archived: bool = False, released: bool = False) → Version[source]
1565 | Create a version in a project and return a Resource for it.
1566 | 
1567 | Parameters:
1568 | name (str) – name of the version to create
1569 | 
1570 | project (str) – key of the project to create the version in
1571 | 
1572 | description (str) – a description of the version
1573 | 
1574 | releaseDate (Optional[Any]) – the release date assigned to the version
1575 | 
1576 | startDate (Optional[Any]) – The start date for the version
1577 | 
1578 | archived (bool) – True to create an archived version. (Default: False)
1579 | 
1580 | released (bool) – True to create a released version. (Default: False)
1581 | 
1582 | Returns:
1583 | Version
1584 | 
1585 | move_version(id: str, after: str | None = None, position: str | None = None) → Version[source]
1586 | Move a version within a project’s ordered version list and return a new version Resource for it.
1587 | 
1588 | One, but not both, of after and position must be specified.
1589 | 
1590 | Parameters:
1591 | id (str) – ID of the version to move
1592 | 
1593 | after (str) – the self attribute of a version to place the specified version after (that is, higher in the list)
1594 | 
1595 | position (Optional[str]) – the absolute position to move this version to: must be one of First, Last, Earlier, or Later
1596 | 
1597 | Returns:
1598 | Version
1599 | 
1600 | version(id: str, expand: Any | None = None) → Version[source]
1601 | Get a version Resource.
1602 | 
1603 | Parameters:
1604 | id (str) – ID of the version to get
1605 | 
1606 | expand (Optional[Any]) – extra information to fetch inside each resource
1607 | 
1608 | Returns:
1609 | Version
1610 | 
1611 | version_count_related_issues(id: str)[source]
1612 | Get a dict of the counts of issues fixed and affected by a version.
1613 | 
1614 | Parameters:
1615 | id (str) – the version to count issues for
1616 | 
1617 | version_count_unresolved_issues(id: str)[source]
1618 | Get the number of unresolved issues for a version.
1619 | 
1620 | Parameters:
1621 | id (str) – ID of the version to count issues for
1622 | 
1623 | session() → User[source]
1624 | Get a dict of the current authenticated user’s session information.
1625 | 
1626 | Returns:
1627 | User
1628 | 
1629 | kill_session() → Response[source]
1630 | Destroy the session of the current authenticated user.
1631 | 
1632 | Returns:
1633 | Response
1634 | 
1635 | kill_websudo() → Response | None[source]
1636 | Destroy the user’s current WebSudo session.
1637 | 
1638 | Works only for non-cloud deployments, for others does nothing.
1639 | 
1640 | Returns:
1641 | Optional[Response]
1642 | 
1643 | rename_user(old_user: str, new_user: str)[source]
1644 | Rename a Jira user.
1645 | 
1646 | Parameters:
1647 | old_user (str) – Old username login
1648 | 
1649 | new_user (str) – New username login
1650 | 
1651 | delete_user(username: str) → bool[source]
1652 | Deletes a Jira User.
1653 | 
1654 | Parameters:
1655 | username (str) – Username to delete
1656 | 
1657 | Returns:
1658 | bool – Success of user deletion
1659 | 
1660 | deactivate_user(username: str) → str | int[source]
1661 | Disable/deactivate the user.
1662 | 
1663 | Parameters:
1664 | username (str) – User to be deactivated.
1665 | 
1666 | Returns:
1667 | Union[str, int]
1668 | 
1669 | reindex(force: bool = False, background: bool = True) → bool[source]
1670 | Start jira re-indexing. Returns True if reindexing is in progress or not needed, or False.
1671 | 
1672 | If you call reindex() without any parameters it will perform a background reindex only if Jira thinks it should do it.
1673 | 
1674 | Parameters:
1675 | force (bool) – True to reindex even if Jira doesn’t say this is needed. (Default: False)
1676 | 
1677 | background (bool) – True to reindex in background, slower but does not impact the users. (Default: True)
1678 | 
1679 | Returns:
1680 | bool – True if reindexing is in progress or not needed
1681 | 
1682 | backup(filename: str = 'backup.zip', attachments: bool = False) → bool | int | None[source]
1683 | Will call jira export to backup as zipped xml. Returning with success does not mean that the backup process finished.
1684 | 
1685 | Parameters:
1686 | filename (str) – the filename for the backup (Default: “backup.zip”)
1687 | 
1688 | attachments (bool) – True to also backup attachments (Default: False)
1689 | 
1690 | Returns:
1691 | Union[bool, int] – Returns True if successful else it returns the statuscode of the Response or False
1692 | 
1693 | backup_progress() → dict[str, Any] | None[source]
1694 | Return status of cloud backup as a dict.
1695 | 
1696 | Is there a way to get progress for Server version?
1697 | 
1698 | Returns:
1699 | Optional[Dict[str, Any]]
1700 | 
1701 | backup_complete() → bool | None[source]
1702 | Return boolean based on ‘alternativePercentage’ and ‘size’ returned from backup_progress (cloud only).
1703 | 
1704 | backup_download(filename: str | None = None)[source]
1705 | Download backup file from WebDAV (cloud only).
1706 | 
1707 | current_user(field: str | None = None) → str[source]
1708 | Return the accountId (Cloud) else username of the current user.
1709 | 
1710 | For anonymous users it will return a value that evaluates as False.
1711 | 
1712 | Parameters:
1713 | field (Optional[str]) – the name of the identifier field. Defaults to “accountId” for Jira Cloud, else “username”
1714 | 
1715 | Returns:
1716 | str – User’s accountId (Cloud) else username.
1717 | 
1718 | delete_project(pid: str | Project, enable_undo: bool = True) → bool | None[source]
1719 | Delete project from Jira.
1720 | 
1721 | Parameters:
1722 | pid (Union[str, Project]) – Jira projectID or Project or slug.
1723 | 
1724 | enable_undo (bool) – Jira Cloud only. True moves to ‘Trash’. False permanently deletes.
1725 | 
1726 | Raises:
1727 | JIRAError – If project not found or not enough permissions
1728 | 
1729 | ValueError – If pid parameter is not Project, slug or ProjectID
1730 | 
1731 | Returns:
1732 | bool – True if project was deleted
1733 | 
1734 | templates() → dict[source]
1735 | permissionschemes()[source]
1736 | issue_type_schemes() → list[IssueTypeScheme][source]
1737 | Get all issue type schemes defined (Admin required).
1738 | 
1739 | Returns:
1740 | List[IssueTypeScheme] – All the Issue Type Schemes available to the currently logged in user.
1741 | 
1742 | issuesecurityschemes()[source]
1743 | projectcategories()[source]
1744 | avatars(entity='project')[source]
1745 | notificationschemes()[source]
1746 | screens()[source]
1747 | workflowscheme()[source]
1748 | workflows()[source]
1749 | delete_screen(id: str)[source]
1750 | delete_permissionscheme(id: str)[source]
1751 | get_issue_type_scheme_associations(id: str) → list[Project][source]
1752 | For the specified issue type scheme, returns all of the associated projects. (Admin required).
1753 | 
1754 | Parameters:
1755 | id (str) – The issue type scheme id.
1756 | 
1757 | Returns:
1758 | List[Project] – Associated Projects for the Issue Type Scheme.
1759 | 
1760 | create_project(key: str, name: str | None = None, assignee: str | None = None, ptype: str = 'software', template_name: str | None = None, avatarId: int | None = None, issueSecurityScheme: int | None = None, permissionScheme: int | None = None, projectCategory: int | None = None, notificationScheme: int = 10000, categoryId: int | None = None, url: str = '')[source]
1761 | Create a project with the specified parameters.
1762 | 
1763 | Parameters:
1764 | key (str) – Mandatory. Must match Jira project key requirements, usually only 2-10 uppercase characters.
1765 | 
1766 | name (Optional[str]) – If not specified it will use the key value.
1767 | 
1768 | assignee (Optional[str]) – Key of the lead, if not specified it will use current user.
1769 | 
1770 | ptype (Optional[str]) – Determines the type of project that should be created. Defaults to ‘software’.
1771 | 
1772 | 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.
1773 | 
1774 | avatarId (Optional[int]) – ID of the avatar to use for the project.
1775 | 
1776 | issueSecurityScheme (Optional[int]) – Determines the security scheme to use. If none provided, will fetch the scheme named ‘Default’ or the first scheme returned.
1777 | 
1778 | permissionScheme (Optional[int]) – Determines the permission scheme to use. If none provided, will fetch the scheme named ‘Default Permission Scheme’ or the first scheme returned.
1779 | 
1780 | projectCategory (Optional[int]) – Determines the category the project belongs to. If none provided, will fetch the one named ‘Default’ or the first category returned.
1781 | 
1782 | notificationScheme (Optional[int]) – Determines the notification scheme to use.
1783 | 
1784 | categoryId (Optional[int]) – Same as projectCategory. Can be used interchangeably.
1785 | 
1786 | url (Optional[str]) – A link to information about the project, such as documentation.
1787 | 
1788 | Returns:
1789 | Union[bool,int] – Should evaluate to False if it fails otherwise it will be the new project id.
1790 | 
1791 | add_user(username: str, email: str, directoryId: int = 1, password: str | None = None, fullname: str | None = None, notify: bool = False, active: bool = True, ignore_existing: bool = False, application_keys: list | None = None)[source]
1792 | Create a new Jira user.
1793 | 
1794 | Parameters:
1795 | username (str) – the username of the new user
1796 | 
1797 | email (str) – email address of the new user
1798 | 
1799 | directoryId (int) – The directory ID the new user should be a part of (Default: 1)
1800 | 
1801 | password (Optional[str]) – Optional, the password for the new user
1802 | 
1803 | fullname (Optional[str]) – Optional, the full name of the new user
1804 | 
1805 | notify (bool) – True to send a notification to the new user. (Default: False)
1806 | 
1807 | active (bool) – True to make the new user active upon creation. (Default: True)
1808 | 
1809 | ignore_existing (bool) – True to ignore existing users. (Default: False)
1810 | 
1811 | application_keys (Optional[list]) – Keys of products user should have access to
1812 | 
1813 | Raises:
1814 | JIRAError – If username already exists and ignore_existing has not been set to True.
1815 | 
1816 | Returns:
1817 | bool – Whether the user creation was successful.
1818 | 
1819 | add_user_to_group(username: str, group: str) → bool | dict[str, Any][source]
1820 | Add a user to an existing group.
1821 | 
1822 | Parameters:
1823 | username (str) – Username that will be added to specified group.
1824 | 
1825 | group (str) – Group that the user will be added to.
1826 | 
1827 | Returns:
1828 | Union[bool,Dict[str,Any]] – json response from Jira server for success or a value that evaluates as False in case of failure.
1829 | 
1830 | remove_user_from_group(username: str, groupname: str) → bool[source]
1831 | Remove a user from a group.
1832 | 
1833 | Parameters:
1834 | username (str) – The user to remove from the group.
1835 | 
1836 | groupname (str) – The group that the user will be removed from.
1837 | 
1838 | Returns:
1839 | bool
1840 | 
1841 | role() → list[dict[str, Any]][source]
1842 | Return Jira role information.
1843 | 
1844 | Returns:
1845 | List[Dict[str,Any]] – List of current user roles
1846 | 
1847 | get_igrid(issueid: str, customfield: str, schemeid: str)[source]
1848 | boards(startAt: int = 0, maxResults: int = 50, type: str | None = None, name: str | None = None, projectKeyOrID=None) → ResultList[Board][source]
1849 | Get a list of board resources.
1850 | 
1851 | Parameters:
1852 | startAt – The starting index of the returned boards. Base index: 0.
1853 | 
1854 | maxResults – The maximum number of boards to return per page. Default: 50
1855 | 
1856 | type – Filters results to boards of the specified type. Valid values: scrum, kanban.
1857 | 
1858 | name – Filters results to boards that match or partially match the specified name.
1859 | 
1860 | projectKeyOrID – Filters results to boards that match the specified project key or ID.
1861 | 
1862 | Returns:
1863 | ResultList[Board]
1864 | 
1865 | sprints(board_id: int, extended: bool | None = None, startAt: int = 0, maxResults: int = 50, state: str | None = None) → ResultList[Sprint][source]
1866 | Get a list of sprint Resources.
1867 | 
1868 | Parameters:
1869 | board_id (int) – the board to get sprints from
1870 | 
1871 | extended (bool) – Deprecated.
1872 | 
1873 | startAt (int) – the index of the first sprint to return (0 based)
1874 | 
1875 | maxResults (int) – the maximum number of sprints to return
1876 | 
1877 | state (str) – Filters results to sprints in specified states. Valid values: future, active, closed. You can define multiple states separated by commas
1878 | 
1879 | Returns:
1880 | ResultList[Sprint] – List of sprints.
1881 | 
1882 | sprints_by_name(id: str | int, extended: bool = False, state: str | None = None) → dict[str, dict[str, Any]][source]
1883 | Get a dictionary of sprint Resources where the name of the sprint is the key.
1884 | 
1885 | Parameters:
1886 | board_id (int) – the board to get sprints from
1887 | 
1888 | extended (bool) – Deprecated.
1889 | 
1890 | state (str) – Filters results to sprints in specified states. Valid values: future, active, closed. You can define multiple states separated by commas
1891 | 
1892 | Returns:
1893 | Dict[str, Dict[str, Any]] – dictionary of sprints with the sprint name as key
1894 | 
1895 | update_sprint(id: str | int, name: str | None = None, startDate: Any | None = None, endDate: Any | None = None, state: str | None = None, goal: str | None = None) → dict[str, Any][source]
1896 | Updates the sprint with the given values.
1897 | 
1898 | Parameters:
1899 | id (Union[str, int]) – The id of the sprint to update
1900 | 
1901 | name (Optional[str]) – The name to update your sprint to
1902 | 
1903 | startDate (Optional[Any]) – The start date for the sprint
1904 | 
1905 | endDate (Optional[Any]) – The start date for the sprint
1906 | 
1907 | state – (Optional[str]): The state of the sprint
1908 | 
1909 | goal – (Optional[str]): The goal of the sprint
1910 | 
1911 | Returns:
1912 | Dict[str, Any]
1913 | 
1914 | incompletedIssuesEstimateSum(board_id: str, sprint_id: str)[source]
1915 | Return the total incompleted points this sprint.
1916 | 
1917 | removed_issues(board_id: str, sprint_id: str)[source]
1918 | Return the completed issues for the sprint.
1919 | 
1920 | Returns:
1921 | List[Issue]
1922 | 
1923 | removedIssuesEstimateSum(board_id: str, sprint_id: str)[source]
1924 | Return the total incompleted points this sprint.
1925 | 
1926 | sprint_info(board_id: str, sprint_id: str) → dict[str, Any][source]
1927 | Return the information about a sprint.
1928 | 
1929 | Parameters:
1930 | board_id (str) – the board retrieving issues from. Deprecated and ignored.
1931 | 
1932 | sprint_id (str) – the sprint retrieving issues from
1933 | 
1934 | Returns:
1935 | Dict[str, Any]
1936 | 
1937 | sprint(id: int) → Sprint[source]
1938 | Return the information about a sprint.
1939 | 
1940 | Parameters:
1941 | sprint_id (int) – the sprint retrieving issues from
1942 | 
1943 | Returns:
1944 | Sprint
1945 | 
1946 | delete_board(id)[source]
1947 | Delete an agile board.
1948 | 
1949 | create_board(name: str, filter_id: str, project_ids: str | None = None, preset: str = 'scrum', location_type: Literal['user', 'project'] = 'user', location_id: str | None = None) → Board[source]
1950 | Create a new board for the project_ids.
1951 | 
1952 | Parameters:
1953 | name (str) – name of the Board (<255 characters).
1954 | 
1955 | 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).
1956 | 
1957 | project_ids (str) – Deprecated. See location_id.
1958 | 
1959 | preset (str) – What preset/type to use for this Board, options: kanban, scrum, agility. (Default: “scrum”)
1960 | 
1961 | location_type (str) – the location type. Available in Cloud. (Default: “user”)
1962 | 
1963 | 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.
1964 | 
1965 | Returns:
1966 | Board – The newly created board
1967 | 
1968 | create_sprint(name: str, board_id: int, startDate: Any | None = None, endDate: Any | None = None, goal: str | None = None) → Sprint[source]
1969 | Create a new sprint for the board_id.
1970 | 
1971 | Parameters:
1972 | name (str) – Name of the sprint
1973 | 
1974 | board_id (int) – Which board the sprint should be assigned.
1975 | 
1976 | startDate (Optional[Any]) – Start date for the sprint.
1977 | 
1978 | endDate (Optional[Any]) – End date for the sprint.
1979 | 
1980 | goal (Optional[str]) – Goal for the sprint.
1981 | 
1982 | Returns:
1983 | Sprint – The newly created Sprint
1984 | 
1985 | add_issues_to_sprint(sprint_id: int, issue_keys: list[str]) → Response[source]
1986 | Add the issues in issue_keys to the sprint_id.
1987 | 
1988 | The sprint must be started but not completed.
1989 | 
1990 | 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.
1991 | 
1992 | If a sprint was not started, then have to edit the marker and copy the rank of each issue too.
1993 | 
1994 | Parameters:
1995 | sprint_id (int) – the sprint to add issues to
1996 | 
1997 | issue_keys (List[str]) – the issues to add to the sprint
1998 | 
1999 | Returns:
2000 | Response
2001 | 
2002 | add_issues_to_epic(epic_id: str, issue_keys: str | list[str], ignore_epics: bool | None = None) → Response[source]
2003 | Add the issues in issue_keys to the epic_id.
2004 | 
2005 | Issues can only exist in one Epic!
2006 | 
2007 | Parameters:
2008 | epic_id (str) – The ID for the epic where issues should be added.
2009 | 
2010 | issue_keys (Union[str, List[str]]) – The list (or comma separated str) of issues to add to the epic
2011 | 
2012 | ignore_epics (bool) – Deprecated.
2013 | 
2014 | Returns:
2015 | Response
2016 | 
2017 | rank(issue: str, next_issue: str | None = None, prev_issue: str | None = None) → Response[source]
2018 | Rank an issue before/after another using the default Ranking field, the one named ‘Rank’.
2019 | 
2020 | Pass only ONE of next_issue or prev_issue.
2021 | 
2022 | Parameters:
2023 | issue (str) – issue key of the issue to be ranked before/after the second one.
2024 | 
2025 | next_issue (str) – issue key that the first issue is to be ranked before.
2026 | 
2027 | prev_issue (str) – issue key that the first issue is to be ranked after.
2028 | 
2029 | Returns:
2030 | Response
2031 | 
2032 | move_to_backlog(issue_keys: list[str]) → Response[source]
2033 | Move issues in issue_keys to the backlog, removing them from all sprints that have not been completed.
2034 | 
2035 | Parameters:
2036 | issue_keys (List[str]) – the issues to move to the backlog
2037 | 
2038 | Raises:
2039 | JIRAError – If moving issues to backlog fails
2040 | 
2041 | Returns:
2042 | Response
2043 | 
2044 | pinned_comments(issue: int | str) → list[PinnedComment][source]
2045 | Get a list of pinned comment Resources of the issue provided.
2046 | 
2047 | Parameters:
2048 | issue (Union[int, str]) – the issue ID or key to get the comments from
2049 | 
2050 | Returns:
2051 | List[PinnedComment]
2052 | 
2053 | pin_comment(issue: int | str, comment: int | str, pin: bool) → Response[source]
2054 | Pin/Unpin a comment on the issue.
2055 | 
2056 | Parameters:
2057 | issue (Union[int, str]) – the issue ID or key to get the comments from
2058 | 
2059 | comment (Union[int, str]) – the comment ID
2060 | 
2061 | pin (bool) – Pin (True) or Unpin (False)
2062 | 
2063 | Returns:
2064 | Response
2065 | 
2066 | 6.1.2. jira.config module
2067 | Config handler.
2068 | 
2069 | This module allows people to keep their jira server credentials outside their script, in a configuration file that is not saved in the source control.
2070 | 
2071 | Also, this simplifies the scripts by not having to write the same initialization code for each script.
2072 | 
2073 | jira.config.get_jira(profile: str | None = None, url: str = 'http://localhost:2990', username: str = 'admin', password: str = 'admin', appid=None, autofix=False, verify: bool | str = True)[source]
2074 | Return a JIRA object by loading the connection details from the config.ini file.
2075 | 
2076 | Parameters:
2077 | profile (Optional[str]) – The name of the section from config.ini file that stores server config url/username/password
2078 | 
2079 | url (str) – URL of the Jira server
2080 | 
2081 | username (str) – username to use for authentication
2082 | 
2083 | password (str) – password to use for authentication
2084 | 
2085 | appid – appid
2086 | 
2087 | autofix – autofix
2088 | 
2089 | verify (Union[bool, str]) – True to indicate whether SSL certificates should be verified or str path to a CA_BUNDLE file or directory with certificates of trusted CAs. (Default: True)
2090 | 
2091 | Returns:
2092 | JIRA – an instance to a JIRA object.
2093 | 
2094 | Raises:
2095 | EnvironmentError –
2096 | 
2097 | Usage:
2098 | 
2099 | from jira.config import get_jira
2100 | 
2101 | jira = get_jira(profile='jira')
2102 | Also create a config.ini like this and put it in current directory, user home directory or PYTHONPATH.
2103 | 
2104 | [jira]
2105 | url=https://jira.atlassian.com
2106 | # only the `url` is mandatory
2107 | user=...
2108 | pass=...
2109 | appid=...
2110 | verify=...
2111 | 6.1.3. jira.exceptions module
2112 | exception jira.exceptions.JIRAError(text: str | None = None, status_code: int | None = None, url: str | None = None, request: Response | None = None, response: Response | None = None, **kwargs)[source]
2113 | Bases: Exception
2114 | 
2115 | General error raised for all problems in operation of the client.
2116 | 
2117 | __init__(text: str | None = None, status_code: int | None = None, url: str | None = None, request: Response | None = None, response: Response | None = None, **kwargs)[source]
2118 | Creates a JIRAError.
2119 | 
2120 | Parameters:
2121 | text (Optional[str]) – Message for the error.
2122 | 
2123 | status_code (Optional[int]) – Status code for the error.
2124 | 
2125 | url (Optional[str]) – Url related to the error.
2126 | 
2127 | request (Optional[requests.Response]) – Request made related to the error.
2128 | 
2129 | response (Optional[requests.Response]) – Response received related to the error.
2130 | 
2131 | **kwargs – Will be used to get request headers.
2132 | 
2133 | exception jira.exceptions.NotJIRAInstanceError(instance: Any)[source]
2134 | Bases: Exception
2135 | 
2136 | Raised in the case an object is not a JIRA instance.
2137 | 
2138 | __init__(instance: Any)[source]
2139 | 6.1.4. jira.jirashell module
2140 | Starts an interactive Jira session in an ipython terminal.
2141 | 
2142 | Script arguments support changing the server and a persistent authentication over HTTP BASIC or Kerberos.
2143 | 
2144 | jira.jirashell.oauth_dance(server, consumer_key, key_cert_data, print_tokens=False, verify=None)[source]
2145 | jira.jirashell.process_config()[source]
2146 | jira.jirashell.process_command_line()[source]
2147 | jira.jirashell.get_config()[source]
2148 | jira.jirashell.handle_basic_auth(auth, server)[source]
2149 | jira.jirashell.main()[source]
2150 | 6.1.5. jira.resilientsession module
2151 | class jira.resilientsession.PrepareRequestForRetry[source]
2152 | Bases: object
2153 | 
2154 | This class allows for the manipulation of the Request keyword arguments before a retry.
2155 | 
2156 | The prepare() handles the processing of the Request keyword arguments.
2157 | 
2158 | abstract prepare(original_request_kwargs: CaseInsensitiveDict) → CaseInsensitiveDict[source]
2159 | Process the Request’s keyword arguments before retrying the Request.
2160 | 
2161 | Parameters:
2162 | original_request_kwargs (CaseInsensitiveDict) – The keyword arguments of the Request.
2163 | 
2164 | Returns:
2165 | CaseInsensitiveDict – The new keyword arguments to use in the retried Request.
2166 | 
2167 | class jira.resilientsession.PassthroughRetryPrepare[source]
2168 | Bases: PrepareRequestForRetry
2169 | 
2170 | Returns the Request’s keyword arguments unchanged, when no change needs to be made before a retry.
2171 | 
2172 | prepare(original_request_kwargs: CaseInsensitiveDict) → CaseInsensitiveDict[source]
2173 | jira.resilientsession.raise_on_error(resp: Response | None, **kwargs) → TypeGuard[Response][source]
2174 | Handle errors from a Jira Request.
2175 | 
2176 | Parameters:
2177 | resp (Optional[Response]) – Response from Jira request
2178 | 
2179 | Raises:
2180 | JIRAError – If Response is None
2181 | 
2182 | JIRAError – for unhandled 400 status codes.
2183 | 
2184 | Returns:
2185 | TypeGuard[Response] – True if the passed in Response is all good.
2186 | 
2187 | jira.resilientsession.parse_errors(resp: Response) → list[str][source]
2188 | Parse a Jira Error messages from the Response.
2189 | 
2190 | https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#status-codes
2191 | 
2192 | Parameters:
2193 | resp (Response) – The Jira API request’s response.
2194 | 
2195 | Returns:
2196 | List[str] – The error messages list parsed from the Response. An empty list if no error.
2197 | 
2198 | jira.resilientsession.parse_error_msg(resp: Response) → str[source]
2199 | Parse a Jira Error messages from the Response and join them by comma.
2200 | 
2201 | https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#status-codes
2202 | 
2203 | Parameters:
2204 | resp (Response) – The Jira API request’s response.
2205 | 
2206 | Returns:
2207 | str – The error message parsed from the Response. An empty str if no error.
2208 | 
2209 | class jira.resilientsession.ResilientSession(timeout=None, max_retries: int = 3, max_retry_delay: int = 60)[source]
2210 | Bases: Session
2211 | 
2212 | This class is supposed to retry requests that do return temporary errors.
2213 | 
2214 | __recoverable() handles all retry-able errors.
2215 | 
2216 | __init__(timeout=None, max_retries: int = 3, max_retry_delay: int = 60)[source]
2217 | A Session subclass catered for the Jira API with exponential delaying retry.
2218 | 
2219 | Parameters:
2220 | timeout (Optional[Union[Union[float, int], Tuple[float, float]]]) – Connection/read timeout delay. Defaults to None.
2221 | 
2222 | max_retries (int) – Max number of times to retry a request. Defaults to 3.
2223 | 
2224 | max_retry_delay (int) – Max delay allowed between retries. Defaults to 60.
2225 | 
2226 | request(method: str, url: str | bytes, _prepare_retry_class: ~jira.resilientsession.PrepareRequestForRetry = <jira.resilientsession.PassthroughRetryPrepare object>, **kwargs) → Response[source]
2227 | This is an intentional override of Session.request() to inject some error handling and retry logic.
2228 | 
2229 | Raises:
2230 | Exception – Various exceptions as defined in py:method:raise_on_error.
2231 | 
2232 | Returns:
2233 | Response – The response.
2234 | 
2235 | 6.1.6. jira.resources module
2236 | jira.client.ResourceType = alias of TypeVar(‘ResourceType’, contravariant=True, bound=jira.resources.Resource)
2237 | Type variable.
2238 | 
2239 | Usage:
2240 | 
2241 | T = TypeVar('T')  # Can be anything
2242 | A = TypeVar('A', str, bytes)  # Must be str or bytes
2243 | Type variables exist primarily for the benefit of static type checkers. They serve as the parameters for generic types as well as for generic function definitions. See class Generic for more information on generic types. Generic functions work as follows:
2244 | 
2245 | def repeat(x: T, n: int) -> List[T]:
2246 | ‘’’Return a list containing n references to x.’’’ return [x]*n
2247 | 
2248 | def longest(x: A, y: A) -> A:
2249 | ‘’’Return the longest of two strings.’’’ return x if len(x) >= len(y) else y
2250 | 
2251 | The latter example’s signature is essentially the overloading of (str, str) -> str and (bytes, bytes) -> bytes. Also note that if the arguments are instances of some subclass of str, the return type is still plain str.
2252 | 
2253 | At runtime, isinstance(x, T) and issubclass(C, T) will raise TypeError.
2254 | 
2255 | Type variables defined with covariant=True or contravariant=True can be used to declare covariant or contravariant generic types. See PEP 484 for more details. By default generic types are invariant in all type variables.
2256 | 
2257 | Type variables can be introspected. e.g.:
2258 | 
2259 | T.__name__ == ‘T’ T.__constraints__ == () T.__covariant__ == False T.__contravariant__ = False A.__constraints__ == (str, bytes)
2260 | 
2261 | Note that only type variables defined in global scope can be pickled.
2262 | 
2263 | Jira resource definitions.
2264 | 
2265 | This module implements the Resource classes that translate JSON from Jira REST resources into usable objects.
2266 | 
2267 | class jira.resources.Resource(resource: str, options: dict[str, Any], session: ResilientSession, base_url: str = '{server}/rest/{rest_path}/{rest_api_version}/{path}')[source]
2268 | Bases: object
2269 | 
2270 | Models a URL-addressable resource in the Jira REST API.
2271 | 
2272 | All Resource objects provide the following: find() – get a resource from the server and load it into the current object (though clients should use the methods in the JIRA class instead of this method directly) update() – changes the value of this resource on the server and returns a new resource object for it delete() – deletes this resource from the server self – the URL of this resource on the server raw – dict of properties parsed out of the JSON response from the server
2273 | 
2274 | Subclasses will implement update() and delete() as appropriate for the specific resource.
2275 | 
2276 | All Resources have a resource path of the form:
2277 | 
2278 | issue
2279 | 
2280 | project/{0}
2281 | 
2282 | issue/{0}/votes
2283 | 
2284 | issue/{0}/comment/{1}
2285 | 
2286 | where the bracketed numerals are placeholders for ID values that are filled in from the ids parameter to find().
2287 | 
2288 | JIRA_BASE_URL = '{server}/rest/{rest_path}/{rest_api_version}/{path}'
2289 | _READABLE_IDS = ('displayName', 'key', 'name', 'accountId', 'filename', 'value', 'scope', 'votes', 'id', 'mimeType', 'closed')
2290 | _HASH_IDS = ('self', 'type', 'key', 'id', 'name')
2291 | __init__(resource: str, options: dict[str, Any], session: ResilientSession, base_url: str = '{server}/rest/{rest_path}/{rest_api_version}/{path}')[source]
2292 | Initializes a generic resource.
2293 | 
2294 | Parameters:
2295 | resource (str) – The name of the resource.
2296 | 
2297 | options (Dict[str,str]) – Options for the new resource
2298 | 
2299 | session (ResilientSession) – Session used for the resource.
2300 | 
2301 | base_url (Optional[str]) – The Base Jira url.
2302 | 
2303 | find(id: tuple[str, ...] | int | str, params: dict[str, str] | None = None)[source]
2304 | Finds a resource based on the input parameters.
2305 | 
2306 | Parameters:
2307 | id (Union[Tuple[str, str], int, str]) – id
2308 | 
2309 | params (Optional[Dict[str, str]]) – params
2310 | 
2311 | _find_by_url(url: str, params: dict[str, str] | None = None)[source]
2312 | Finds a resource on the specified url.
2313 | 
2314 | The resource is loaded with the JSON data returned by doing a request on the specified url.
2315 | 
2316 | Parameters:
2317 | url (str) – url
2318 | 
2319 | params (Optional[Dict[str, str]]) – params
2320 | 
2321 | _get_url(path: str) → str[source]
2322 | Gets the url for the specified path.
2323 | 
2324 | Parameters:
2325 | path (str) – str
2326 | 
2327 | Returns:
2328 | str
2329 | 
2330 | update(fields: dict[str, Any] | None = None, async_: bool | None = None, jira: JIRA | None = None, notify: bool = True, **kwargs: Any)[source]
2331 | Update this resource on the server.
2332 | 
2333 | Keyword arguments are marshalled into a dict before being sent. If this resource doesn’t support PUT, a JIRAError will be raised; subclasses that specialize this method will only raise errors in case of user error.
2334 | 
2335 | Parameters:
2336 | fields (Optional[Dict[str, Any]]) – Fields which should be updated for the object.
2337 | 
2338 | async (Optional[bool]) – True to add the request to the queue, so it can be executed later using async_run()
2339 | 
2340 | jira (jira.client.JIRA) – Instance of Jira Client
2341 | 
2342 | notify (bool) – True to notify watchers about the update, sets parameter notifyUsers. (Default: True). Admin or project admin permissions are required to disable the notification.
2343 | 
2344 | kwargs (Any) – extra arguments to the PUT request.
2345 | 
2346 | delete(params: dict[str, Any] | None = None) → Response | None[source]
2347 | Delete this resource from the server, passing the specified query parameters.
2348 | 
2349 | If this resource doesn’t support DELETE, a JIRAError will be raised; subclasses that specialize this method will only raise errors in case of user error.
2350 | 
2351 | Parameters:
2352 | params – Parameters for the delete request.
2353 | 
2354 | Returns:
2355 | Optional[Response] – Returns None if async
2356 | 
2357 | _load(url: str, headers={}, params: dict[str, str] | None = None, path: str | None = None)[source]
2358 | Load a resource.
2359 | 
2360 | Parameters:
2361 | url (str) – url
2362 | 
2363 | headers (Optional[CaseInsensitiveDict]) – headers. Defaults to CaseInsensitiveDict().
2364 | 
2365 | params (Optional[Dict[str,str]]) – params to get request. Defaults to None.
2366 | 
2367 | path (Optional[str]) – field to get. Defaults to None.
2368 | 
2369 | Raises:
2370 | ValueError – If json cannot be loaded
2371 | 
2372 | _parse_raw(raw: dict[str, Any])[source]
2373 | Parse a raw dictionary to create a resource.
2374 | 
2375 | Parameters:
2376 | raw (Dict[str, Any])
2377 | 
2378 | _default_headers(user_headers)[source]
2379 | class jira.resources.Issue(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2380 | Bases: Resource
2381 | 
2382 | A Jira issue.
2383 | 
2384 | class _IssueFields[source]
2385 | Bases: AnyLike
2386 | 
2387 | class _Comment[source]
2388 | Bases: object
2389 | 
2390 | __init__() → None[source]
2391 | class _Worklog[source]
2392 | Bases: object
2393 | 
2394 | __init__() → None[source]
2395 | __init__()[source]
2396 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2397 | update(fields: dict[str, Any] | None = None, update: dict[str, Any] | None = None, async_: bool | None = None, jira: JIRA | None = None, notify: bool = True, **fieldargs)[source]
2398 | Update this issue on the server.
2399 | 
2400 | 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.
2401 | 
2402 | Jira projects may contain many issue types. Some issue screens have different requirements for fields in an issue. This information is available through the JIRA.editmeta() method. Further examples are available here: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Edit+issues
2403 | 
2404 | Parameters:
2405 | fields (Dict[str,Any]) – a dict containing field names and the values to use
2406 | 
2407 | update (Dict[str,Any]) – a dict containing update the operations to apply
2408 | 
2409 | async (Optional[bool]) – True to add the request to the queue, so it can be executed later using async_run() (Default: None))
2410 | 
2411 | jira (Optional[jira.client.JIRA]) – JIRA instance.
2412 | 
2413 | notify (bool) – True to notify watchers about the update, sets parameter notifyUsers. (Default: True). Admin or project admin permissions are required to disable the notification.
2414 | 
2415 | fieldargs (dict) – keyword arguments will generally be merged into fields, except lists, which will be merged into updates
2416 | 
2417 | get_field(field_name: str) → Any[source]
2418 | Obtain the (parsed) value from the Issue’s field.
2419 | 
2420 | Parameters:
2421 | field_name (str) – The name of the field to get
2422 | 
2423 | Raises:
2424 | AttributeError – If the field does not exist or if the field starts with an _
2425 | 
2426 | Returns:
2427 | Any – Returns the parsed data stored in the field. For example, “project” would be of class Project
2428 | 
2429 | add_field_value(field: str, value: str)[source]
2430 | Add a value to a field that supports multiple values, without resetting the existing values.
2431 | 
2432 | This should work with: labels, multiple checkbox lists, multiple select
2433 | 
2434 | Parameters:
2435 | field (str) – The field name
2436 | 
2437 | value (str) – The field’s value
2438 | 
2439 | delete(deleteSubtasks=False)[source]
2440 | Delete this issue from the server.
2441 | 
2442 | Parameters:
2443 | deleteSubtasks (bool) – True to also delete subtasks. If any are present the Issue won’t be deleted (Default: True)
2444 | 
2445 | permalink()[source]
2446 | Get the URL of the issue, the browsable one not the REST one.
2447 | 
2448 | Returns:
2449 | str – URL of the issue
2450 | 
2451 | class jira.resources.Comment(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2452 | Bases: Resource
2453 | 
2454 | An issue comment.
2455 | 
2456 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2457 | update(fields: dict[str, Any] | None = None, async_: bool | None = None, jira: JIRA | None = None, body: str = '', visibility: dict[str, str] | None = None, is_internal: bool = False, notify: bool = True)[source]
2458 | Update a comment.
2459 | 
2460 | Keyword arguments are marshalled into a dict before being sent.
2461 | 
2462 | Parameters:
2463 | fields (Optional[Dict[str, Any]]) – DEPRECATED => a comment doesn’t have fields
2464 | 
2465 | async (Optional[bool]) – True to add the request to the queue, so it can be executed later using async_run() (Default: None))
2466 | 
2467 | jira (jira.client.JIRA) – Instance of Jira Client
2468 | 
2469 | 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.
2470 | 
2471 | body (str) – New text of the comment
2472 | 
2473 | is_internal (bool) – True to mark the comment as ‘Internal’ in Jira Service Desk (Default: False)
2474 | 
2475 | notify (bool) – True to notify watchers about the update, sets parameter notifyUsers. (Default: True). Admin or project admin permissions are required to disable the notification.
2476 | 
2477 | class jira.resources.Project(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2478 | Bases: Resource
2479 | 
2480 | A Jira project.
2481 | 
2482 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2483 | class jira.resources.Attachment(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2484 | Bases: Resource
2485 | 
2486 | An issue attachment.
2487 | 
2488 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2489 | get()[source]
2490 | Return the file content as a string.
2491 | 
2492 | iter_content(chunk_size=1024)[source]
2493 | Return the file content as an iterable stream.
2494 | 
2495 | class jira.resources.Component(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2496 | Bases: Resource
2497 | 
2498 | A project component.
2499 | 
2500 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2501 | delete(moveIssuesTo: str | None = None)[source]
2502 | Delete this component from the server.
2503 | 
2504 | Parameters:
2505 | moveIssuesTo – the name of the component to which to move any issues this component is applied
2506 | 
2507 | class jira.resources.Dashboard(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2508 | Bases: Resource
2509 | 
2510 | A Jira dashboard.
2511 | 
2512 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2513 | class jira.resources.DashboardItemProperty(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2514 | Bases: Resource
2515 | 
2516 | A jira dashboard item.
2517 | 
2518 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2519 | update(dashboard_id: str, item_id: str, value: dict[str, Any]) → DashboardItemProperty[source]
2520 | Update this resource on the server.
2521 | 
2522 | Keyword arguments are marshalled into a dict before being sent. If this resource doesn’t support PUT, a JIRAError will be raised; subclasses that specialize this method will only raise errors in case of user error.
2523 | 
2524 | Parameters:
2525 | dashboard_id (str) – The id if the dashboard.
2526 | 
2527 | item_id (str) – The id of the dashboard item (DashboardGadget) to target.
2528 | 
2529 | value (dict[str, Any]) – The value of the targeted property key.
2530 | 
2531 | Returns:
2532 | DashboardItemProperty
2533 | 
2534 | delete(dashboard_id: str, item_id: str) → Response[source]
2535 | Delete dashboard item property.
2536 | 
2537 | Parameters:
2538 | dashboard_id (str) – The id of the dashboard.
2539 | 
2540 | item_id (str) – The id of the dashboard item (DashboardGadget).
2541 | 
2542 | Returns:
2543 | Response
2544 | 
2545 | class jira.resources.DashboardItemPropertyKey(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2546 | Bases: Resource
2547 | 
2548 | A jira dashboard item property key.
2549 | 
2550 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2551 | class jira.resources.Filter(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2552 | Bases: Resource
2553 | 
2554 | An issue navigator filter.
2555 | 
2556 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2557 | class jira.resources.DashboardGadget(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2558 | Bases: Resource
2559 | 
2560 | A jira dashboard gadget.
2561 | 
2562 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2563 | update(dashboard_id: str, color: str | None = None, position: dict[str, Any] | None = None, title: str | None = None) → DashboardGadget[source]
2564 | Update this resource on the server.
2565 | 
2566 | Keyword arguments are marshalled into a dict before being sent. If this resource doesn’t support PUT, a JIRAError will be raised; subclasses that specialize this method will only raise errors in case of user error.
2567 | 
2568 | Parameters:
2569 | dashboard_id (str) – The id of the dashboard to add the gadget to required.
2570 | 
2571 | color (str) – The color of the gadget, should be one of: blue, red, yellow, green, cyan, purple, gray, or white.
2572 | 
2573 | ignore_uri_and_module_key_validation (bool) – Whether to ignore the validation of the module key and URI. For example, when a gadget is created that is part of an application that is not installed.
2574 | 
2575 | position (dict[str, int]) – A dictionary containing position information like - {“column”: 0, “row”, 1}.
2576 | 
2577 | title (str) – The title of the gadget.
2578 | 
2579 | Returns:
2580 | DashboardGadget
2581 | 
2582 | delete(dashboard_id: str) → Response[source]
2583 | Delete gadget from dashboard.
2584 | 
2585 | Parameters:
2586 | dashboard_id (str) – The id of the dashboard.
2587 | 
2588 | Returns:
2589 | Response
2590 | 
2591 | class jira.resources.Votes(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2592 | Bases: Resource
2593 | 
2594 | Vote information on an issue.
2595 | 
2596 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2597 | class jira.resources.PermissionScheme(options, session, raw=None)[source]
2598 | Bases: Resource
2599 | 
2600 | Permissionscheme information on a project.
2601 | 
2602 | __init__(options, session, raw=None)[source]
2603 | class jira.resources.Watchers(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2604 | Bases: Resource
2605 | 
2606 | Watcher information on an issue.
2607 | 
2608 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2609 | delete(username)[source]
2610 | Remove the specified user from the watchers list.
2611 | 
2612 | class jira.resources.Worklog(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2613 | Bases: Resource
2614 | 
2615 | Worklog on an issue.
2616 | 
2617 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2618 | delete(adjustEstimate: str | None = None, newEstimate=None, increaseBy=None)[source]
2619 | Delete this worklog entry from its associated issue.
2620 | 
2621 | Parameters:
2622 | adjustEstimate – one of new, leave, manual or auto. auto is the default and adjusts the estimate automatically. leave leaves the estimate unchanged by this deletion.
2623 | 
2624 | newEstimate – combined with adjustEstimate=new, set the estimate to this value
2625 | 
2626 | increaseBy – combined with adjustEstimate=manual, increase the remaining estimate by this amount
2627 | 
2628 | class jira.resources.IssueLink(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2629 | Bases: Resource
2630 | 
2631 | Link between two issues.
2632 | 
2633 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2634 | class jira.resources.IssueLinkType(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2635 | Bases: Resource
2636 | 
2637 | Type of link between two issues.
2638 | 
2639 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2640 | class jira.resources.IssueProperty(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2641 | Bases: Resource
2642 | 
2643 | Custom data against an issue.
2644 | 
2645 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2646 | _find_by_url(url: str, params: dict[str, str] | None = None)[source]
2647 | class jira.resources.IssueSecurityLevelScheme(options, session, raw=None)[source]
2648 | Bases: Resource
2649 | 
2650 | IssueSecurityLevelScheme information on a project.
2651 | 
2652 | __init__(options, session, raw=None)[source]
2653 | class jira.resources.IssueType(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2654 | Bases: Resource
2655 | 
2656 | Type of issue.
2657 | 
2658 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2659 | class jira.resources.IssueTypeScheme(options, session, raw=None)[source]
2660 | Bases: Resource
2661 | 
2662 | An issue type scheme.
2663 | 
2664 | __init__(options, session, raw=None)[source]
2665 | class jira.resources.NotificationScheme(options, session, raw=None)[source]
2666 | Bases: Resource
2667 | 
2668 | NotificationScheme information on a project.
2669 | 
2670 | __init__(options, session, raw=None)[source]
2671 | class jira.resources.Priority(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2672 | Bases: Resource
2673 | 
2674 | Priority that can be set on an issue.
2675 | 
2676 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2677 | class jira.resources.PriorityScheme(options, session, raw=None)[source]
2678 | Bases: Resource
2679 | 
2680 | PriorityScheme information on a project.
2681 | 
2682 | __init__(options, session, raw=None)[source]
2683 | class jira.resources.Version(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2684 | Bases: Resource
2685 | 
2686 | A version of a project.
2687 | 
2688 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2689 | delete(moveFixIssuesTo=None, moveAffectedIssuesTo=None)[source]
2690 | Delete this project version from the server.
2691 | 
2692 | If neither of the arguments are specified, the version is removed from all issues it is attached to.
2693 | 
2694 | Parameters:
2695 | moveFixIssuesTo – in issues for which this version is a fix version, add this version to the fix version list
2696 | 
2697 | moveAffectedIssuesTo – in issues for which this version is an affected version, add this version to the affected version list
2698 | 
2699 | update(**kwargs)[source]
2700 | Update this project version from the server. It is prior used to archive versions.
2701 | 
2702 | Refer to Atlassian REST API documentation.
2703 | 
2704 | Example:
2705 | >> version_id = "10543"
2706 | >> version = JIRA("https://atlassian.org").version(version_id)
2707 | >> print(version.name)
2708 | "some_version_name"
2709 | >> version.update(name="another_name")
2710 | >> print(version.name)
2711 | "another_name"
2712 | >> version.update(archived=True)
2713 | >> print(version.archived)
2714 | True
2715 | class jira.resources.WorkflowScheme(options, session, raw=None)[source]
2716 | Bases: Resource
2717 | 
2718 | WorkflowScheme information on a project.
2719 | 
2720 | __init__(options, session, raw=None)[source]
2721 | class jira.resources.Role(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2722 | Bases: Resource
2723 | 
2724 | A role inside a project.
2725 | 
2726 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2727 | update(users: str | list | tuple | None = None, groups: str | list | tuple | None = None)[source]
2728 | Add the specified users or groups to this project role. One of users or groups must be specified.
2729 | 
2730 | Parameters:
2731 | users (Optional[Union[str,List,Tuple]]) – a user or users to add to the role
2732 | 
2733 | groups (Optional[Union[str,List,Tuple]]) – a group or groups to add to the role
2734 | 
2735 | add_user(users: str | list | tuple | None = None, groups: str | list | tuple | None = None)[source]
2736 | Add the specified users or groups to this project role. One of users or groups must be specified.
2737 | 
2738 | Parameters:
2739 | users (Optional[Union[str,List,Tuple]]) – a user or users to add to the role
2740 | 
2741 | groups (Optional[Union[str,List,Tuple]]) – a group or groups to add to the role
2742 | 
2743 | class jira.resources.Resolution(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2744 | Bases: Resource
2745 | 
2746 | A resolution for an issue.
2747 | 
2748 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2749 | class jira.resources.SecurityLevel(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2750 | Bases: Resource
2751 | 
2752 | A security level for an issue or project.
2753 | 
2754 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2755 | class jira.resources.Status(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2756 | Bases: Resource
2757 | 
2758 | Status for an issue.
2759 | 
2760 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2761 | class jira.resources.User(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None, *, _query_param: str = 'username')[source]
2762 | Bases: Resource
2763 | 
2764 | A Jira user.
2765 | 
2766 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None, *, _query_param: str = 'username')[source]
2767 | class jira.resources.Group(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2768 | Bases: Resource
2769 | 
2770 | A Jira user group.
2771 | 
2772 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2773 | class jira.resources.CustomFieldOption(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2774 | Bases: Resource
2775 | 
2776 | An existing option for a custom issue field.
2777 | 
2778 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2779 | class jira.resources.RemoteLink(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2780 | Bases: Resource
2781 | 
2782 | A link to a remote application from an issue.
2783 | 
2784 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2785 | update(object: dict[str, Any] | None, globalId=None, application=None, relationship=None)[source]
2786 | Update a RemoteLink. ‘object’ is required.
2787 | 
2788 | For definitions of the allowable fields for ‘object’ and the keyword arguments ‘globalId’, ‘application’ and ‘relationship’, see https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+for+Remote+Issue+Links.
2789 | 
2790 | Parameters:
2791 | object – the link details to add (see the above link for details)
2792 | 
2793 | globalId – unique ID for the link (see the above link for details)
2794 | 
2795 | application – application information for the link (see the above link for details)
2796 | 
2797 | relationship – relationship description for the link (see the above link for details)
2798 | 
2799 | class jira.resources.Customer(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2800 | Bases: Resource
2801 | 
2802 | A Service Desk customer.
2803 | 
2804 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2805 | class jira.resources.ServiceDesk(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2806 | Bases: Resource
2807 | 
2808 | A Service Desk.
2809 | 
2810 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2811 | class jira.resources.RequestType(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2812 | Bases: Resource
2813 | 
2814 | A Service Desk Request Type.
2815 | 
2816 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2817 | class jira.resources.PinnedComment(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2818 | Bases: Resource
2819 | 
2820 | Pinned comment on an issue.
2821 | 
2822 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2823 | class jira.resources.StatusCategory(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2824 | Bases: Resource
2825 | 
2826 | StatusCategory for an issue.
2827 | 
2828 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2829 | class jira.resources.AgileResource(path: str, options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2830 | Bases: Resource
2831 | 
2832 | A generic Agile resource. Also known as Jira Agile Server, Jira Software and formerly GreenHopper.
2833 | 
2834 | AGILE_BASE_URL = '{server}/rest/{agile_rest_path}/{agile_rest_api_version}/{path}'
2835 | AGILE_BASE_REST_PATH = 'agile'
2836 | Public API introduced in Jira Agile 6.7.7.
2837 | 
2838 | __init__(path: str, options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2839 | class jira.resources.Sprint(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2840 | Bases: AgileResource
2841 | 
2842 | An Agile sprint.
2843 | 
2844 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2845 | class jira.resources.Board(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2846 | Bases: AgileResource
2847 | 
2848 | An Agile board.
2849 | 
2850 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2851 | class jira.resources.Field(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2852 | Bases: Resource
2853 | 
2854 | An issue field.
2855 | 
2856 | A field cannot be fetched from the Jira API individually, but paginated lists of fields are returned by some endpoints.
2857 | 
2858 | __init__(options: dict[str, str], session: ResilientSession, raw: dict[str, Any] | None = None)[source]
2859 | 6.1.7. jira.utils module
2860 | Jira utils used internally.
2861 | 
2862 | class jira.utils.CaseInsensitiveDict(*args, **kwargs)[source]
2863 | Bases: CaseInsensitiveDict
2864 | 
2865 | A case-insensitive dict-like object.
2866 | 
2867 | DEPRECATED: use requests.structures.CaseInsensitiveDict directly.
2868 | 
2869 | Implements all methods and operations of collections.MutableMapping as well as dict’s copy. Also provides lower_items.
2870 | 
2871 | All keys are expected to be strings. The structure remembers the case of the last key to be set, and iter(instance), keys(), items(), iterkeys() will contain case-sensitive keys. However, querying and contains testing is case insensitive:
2872 | 
2873 | cid = CaseInsensitiveDict()
2874 | cid['Accept'] = 'application/json'
2875 | cid['accept'] == 'application/json'  # True
2876 | list(cid) == ['Accept']  # True
2877 | For example, headers['content-encoding'] will return the value of a 'Content-Encoding' response header, regardless of how the header name was originally stored.
2878 | 
2879 | If the constructor, .update, or equality comparison operations are given keys that have equal .lower() s, the behavior is undefined.
2880 | 
2881 | __init__(*args, **kwargs) → None[source]
2882 | jira.utils.threaded_requests(requests)[source]
2883 | jira.utils.json_loads(resp: Response | None) → Any[source]
2884 | Attempts to load json the result of a response.
2885 | 
2886 | Parameters:
2887 | resp (Optional[Response]) – The Response object
2888 | 
2889 | Raises:
2890 | JIRAError – via jira.resilientsession.raise_on_error()
2891 | 
2892 | Returns:
2893 | Union[List[Dict[str, Any]], Dict[str, Any]] – the json
2894 | 
2895 | jira.utils.remove_empty_attributes(data: dict[str, Any]) → dict[str, Any][source]
2896 | A convenience function to remove key/value pairs with None for a value.
2897 | 
2898 | Parameters:
2899 | data – A dictionary.
2900 | 
2901 | Returns:
2902 | Dict[str, Any] – A dictionary with no None key/value pairs.
```
Page 3/4FirstPrevNextLast