Module yajaw.jira
Basic import statement for the module is:
Module description
Module wrapping up the supported Jira resources. It is the main external interface for yajaw users.
async_fetch_all_projects(expand=None)
async
Async call to fetch all projects.
It is intended to be used on asynchronous code. Use the sync version otherwise. Returns all projects visible to the user. It is based on the API GET /rest/api/2/project. That resource is deprecated and will be replaced by GET /rest/api/2/project/search, which will support pagination.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
expand |
str | None
|
Expect a simple string with a comma-separated list of attributes to be expanded. They are: description, issueTypes, lead, and projectKeys. |
None
|
Returns:
Type | Description |
---|---|
list[dict]
|
List of dictionaries representing the returned projects. An empty list is returned if nothing found. |
Source code in yajaw/jira.py
async_fetch_issue(issue_key, expand=None, api=ApiType.CLASSIC)
async
Async call to fetch the details of a single issue.
It is intended to be used on asynchronous code. Use the sync version otherwise. Return the details of a single issue. It is based on the API GET /rest/api/2/issue/{issueKey}. If the identifier doesn't match an issue, a case-insensitive search and check for moved issues is performed. If a matching issue is found its details are returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
issue_key |
str
|
Key identifier for the issue. |
required |
expand |
str | None
|
Expect a simple string with a comma-separated list of attributes to be expanded. They are: renderedFields, name, schema, transitions,editmeta, changelog, and versionedRepresentations. Defaults to None. |
None
|
api |
ApiType
|
Takes the enumeration values ApiType.CLASSIC or ApiType.AGILE as possible values to represent which API to be used. Defaults to ApiType.CLASSIC. |
CLASSIC
|
Returns:
Type | Description |
---|---|
dict
|
Dictionary with the issue details. An empty dictionary is returned if nothing is found. |
Source code in yajaw/jira.py
async_fetch_project(project_key, expand=None)
async
Async call to fetch the details of a single project.
It is intended to be used on asynchronous code. Use the sync version otherwise. Return the details of a single project. It is based on the API GET /rest/api/2/project/{projectKey}.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_key |
str
|
Key identifier for the project. |
required |
expand |
str | None
|
Expect a simple string with a comma-separated list of attributes to be expanded. They are: description, issueTypes, lead, projectKeys, and issueTypeHierarchy. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
dict
|
Dictionary with the project details. An empty dictionary is returned if nothing is found. |
Source code in yajaw/jira.py
async_fetch_projects_from_list(project_keys, expand=None)
async
Async call to fetch the details of a list of projects.
It is intended to be used on asynchronous code. Use the sync version otherwise. Return the details of a list of projects. It is based on the API GET /rest/api/2/project/{projectKey} and the function calls it as many times as items in the provided list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_keys |
list[str]
|
A list of strings representing the project keys. |
required |
expand |
str | None
|
Expect a simple string with a comma-separated list of attributes to be expanded. They are: description, issueTypes, lead, projectKeys, and issueTypeHierarchy. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
list[dict]
|
List of dictionaries representing the returned projects. An empty list is returned if nothing found. |
Source code in yajaw/jira.py
async_search_issues(jql, expand=None)
async
Async call to fetch the result of a search for issues using JQL.
It is intended to be used on asynchronous code. Use the sync version otherwise. Return the results of a search for issues using the provided JQL. It is based on the API POST /rest/api/2/search.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jql |
str
|
A valid Jira Query Language in string format. |
required |
expand |
str | None
|
Expect a simple string with a comma-separated list of attributes to be expanded. They are: renderedFields, name, schema, transitions, operations, editmeta, changelog, and versionedRepresentations. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
list[dict]
|
List of dictionaries representing the returned projects. An empty list is returned if nothing found. |
Source code in yajaw/jira.py
fetch_all_projects(expand=None)
Sync call to fetch all projects.
It is intended to be used on synchronous code. Use the async version otherwise. Returns all projects visible to the user. It is based on the API GET /rest/api/2/project. That resource is deprecated and will be replaced by GET /rest/api/2/project/search, which will support pagination.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
expand |
str | None
|
Expect a simple string with a comma-separated list of attributes to be expanded. They are: description, issueTypes, lead, and projectKeys. |
None
|
Returns:
Type | Description |
---|---|
list[dict]
|
List of dictionaries representing the returned projects. An empty list is returned if nothing found. |
Source code in yajaw/jira.py
fetch_issue(issue_key, expand=None, api=ApiType.CLASSIC)
Sync call to fetch the details of a single issue.
It is intended to be used on synchronous code. Use the async version otherwise. Return the details of a single issue. It is based on the API GET /rest/api/2/issue/{issueKey}. If the identifier doesn't match an issue, a case-insensitive search and check for moved issues is performed. If a matching issue is found its details are returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
issue_key |
str
|
Key identifier for the issue. |
required |
expand |
str | None
|
Expect a simple string with a comma-separated list of attributes to be expanded. They are: renderedFields, name, schema, transitions,editmeta, changelog, and versionedRepresentations. Defaults to None. |
None
|
api |
ApiType
|
Takes the enumeration values ApiType.CLASSIC or ApiType.AGILE as possible values to represent which API to be used. Defaults to ApiType.CLASSIC. |
CLASSIC
|
Returns:
Type | Description |
---|---|
dict
|
Dictionary with the issue details. An empty dictionary is returned if nothing is found. |
Source code in yajaw/jira.py
fetch_project(project_key, expand=None)
Sync call to fetch the details of a single project.
It is intended to be used on synchronous code. Use the async version otherwise. Return the details of a single project. It is based on the API GET /rest/api/2/project/{projectKey}.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_key |
str
|
Key identifier for the project. |
required |
expand |
str | None
|
Expect a simple string with a comma-separated list of attributes to be expanded. They are: description, issueTypes, lead, projectKeys, and issueTypeHierarchy. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
dict
|
Dictionary with the project details. An empty dictionary is returned if nothing is found. |
Source code in yajaw/jira.py
fetch_projects_from_list(project_keys, expand=None)
Sync call to fetch the details of a list of projects.
It is intended to be used on synchronous code. Use the async version otherwise. Return the details of a list of projects. It is based on the API GET /rest/api/2/project/{projectKey} and the function calls it as many times as items in the provided list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_keys |
list[str]
|
A list of strings representing the project keys. |
required |
expand |
str | None
|
Expect a simple string with a comma-separated list of attributes to be expanded. They are: description, issueTypes, lead, projectKeys, and issueTypeHierarchy. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
list[dict]
|
List of dictionaries representing the returned projects. An empty list is returned if nothing found. |
Source code in yajaw/jira.py
search_issues(jql, expand=None)
Sync call to fetch the result of a search for issues using JQL.
It is intended to be used on synchronous code. Use the async version otherwise. Return the results of a search for issues using the provided JQL. It is based on the API POST /rest/api/2/search.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jql |
str
|
A valid Jira Query Language in string format. |
required |
expand |
str | None
|
Expect a simple string with a comma-separated list of attributes to be expanded. They are: renderedFields, name, schema, transitions, operations, editmeta, changelog, and versionedRepresentations. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
list[dict]
|
List of dictionaries representing the returned projects. An empty list is returned if nothing found. |