### Make a GET Request to Jira Endpoint Source: https://jiraone.readthedocs.io/en/latest/_sources/apis.rst.txt Demonstrates making a GET request to a specific Jira endpoint after establishing a login session. This example uses the 'myself' endpoint. ```python from jiraone import LOGIN, endpoint # previous login statement LOGIN.get(endpoint.myself()) ``` -------------------------------- ### Jira Pagination Query Parameters Source: https://jiraone.readthedocs.io/en/latest/apis.html Example of constructing a query string for paginated results. Specifies start index, maximum results, ordering, and status. ```text query = “startAt=0&maxResults=50&orderBy=description,name&status=released &expand=issuestatus” ``` -------------------------------- ### Update User Profile Example Source: https://jiraone.readthedocs.io/en/latest/api.html Example payload for updating user profile fields. ```json {"name": "Lila User", "nickname": "marshmallow"} ``` -------------------------------- ### Install JiraOne via pip Source: https://jiraone.readthedocs.io/en/latest/_sources/index.rst.txt Use these commands to install the library in your Python environment. Requires Python 3.6+ (3.9+ for versions 0.8.6 and above). ```bash pip install jiraone ``` ```bash python3 -m pip install jiraone ``` -------------------------------- ### Import JiraOne Modules Source: https://jiraone.readthedocs.io/en/latest/apis.html Initial setup for accessing login and user reporting functionality. ```python from jiraone import LOGIN, USER ``` -------------------------------- ### Update User Email Example Source: https://jiraone.readthedocs.io/en/latest/api.html Example payload for updating a user's email address. ```json {"email": "prince.nyeche@elfapp.website"} ``` -------------------------------- ### Time in Status Report Output Example Source: https://jiraone.readthedocs.io/en/latest/report.html Example JSON output format for the time in status report, showing issue key, status, and time spent. ```json [ { "author": "Prince Nyeche", "issueKey": "COM-12", "status": "To Do", "summary": "Workflow test 3", "timeStatus": "0h 00m 19s" }, { "author": "Prince Nyeche", "issueKey": "COM-14", "status": "In Progress", "summary": "Workflow test 3", "timeStatus": "8d 6h 32m 52s" } ] ``` -------------------------------- ### JSON Configuration Structure Source: https://jiraone.readthedocs.io/en/latest/apis.html Example of a dictionary structure suitable for storage as a JSON file. ```json { "user": "prince@example.com", "password": "secretpassword", "url": "https://server.example.com" } ``` -------------------------------- ### Initialize API connection Source: https://jiraone.readthedocs.io/en/latest/api.html Basic setup for authenticating with a Jira instance using email and API token. ```python from jiraone import LOGIN, endpoint user = "email" password = "token" link = "https://yourinstance.atlassian.net" LOGIN(user=user, password=password, url=link) def priorities(): load = LOGIN.get(endpoint.get_all_priorities()) if load.status_code == 200: # some expression here ... ``` ```python from jiraone import LOGIN user = "email" password = "token" link = "https://yourinstance.atlassian.net" LOGIN(user=user, password=password, url=link) ``` -------------------------------- ### GET /board/{board_id}/quick-filters Source: https://jiraone.readthedocs.io/en/latest/apis.html Returns all quick filters from a board. ```APIDOC ## GET /board/{board_id}/quick-filters ### Description Returns all quick filters from a board, for a given board ID. ### Method GET ### Parameters #### Path Parameters - **board_id** (int) - Required #### Query Parameters - **start_at** (int) - Optional - Defaults to 0 - **max_results** (int) - Optional - Defaults to 50 ### Response #### Success Response (200) - **url** (string) - The URL of the quick filters resource. ``` -------------------------------- ### GET /rest/api/3/project/search Source: https://jiraone.readthedocs.io/en/latest/apis.html Returns a list of projects available on the instance. ```APIDOC ## GET /rest/api/3/project/search ### Description Returns a list of projects available on an instance. ### Method GET ### Endpoint /rest/api/3/project/search ### Parameters #### Query Parameters - **query** (string) - Optional - Filter by key or name - **searchBy** (string) - Optional - Search criteria - **action** (string) - Optional - Action type (view, browse, edit) - **status** (string) - Optional - Project status (live, archived, deleted) - **expand** (string) - Optional - Expand fields (insight, description, projectKeys, url, issueTypes, lead) - **startAt** (int) - Optional - Pagination start index - **maxResults** (int) - Optional - Maximum number of results ``` -------------------------------- ### Get Projects URL Construction Source: https://jiraone.readthedocs.io/en/latest/apis.html Illustrates how to construct the URL for fetching a list of projects, including optional query parameters for filtering and expansion. ```python `/rest/api/3/project/search` ``` -------------------------------- ### GET /get_all_roles_for_projects Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves project roles and user assignments. ```APIDOC ## GET /get_all_roles_for_projects ### Description Get the roles available in a project and which user is assigned to which role within the project. ### Parameters #### Query Parameters - **roles_folder** (str) - Optional - Folder for role data. - **roles_file_name** (str) - Optional - File to store temp data. - **user_extraction** (str) - Optional - Data extraction file holder. ``` -------------------------------- ### Configure Attachment Mapping Source: https://jiraone.readthedocs.io/en/latest/apis.html Example configuration for mapping CSV column indices when moving attachments. ```text e.g. * key=3, * attach=6, * file=8 ``` -------------------------------- ### Get Quick Filter URL Construction Source: https://jiraone.readthedocs.io/en/latest/apis.html Demonstrates the URL format for accessing a specific quick filter on a Jira board. ```python `/rest/agile/1.0/board/{board_id}/filter/{quick_filter_id}` ``` -------------------------------- ### Get User Mention Source: https://jiraone.readthedocs.io/en/latest/_sources/report.rst.txt Retrieves the mention format for a specific cloud user. ```python from jiraone import LOGIN, USER user = "email" password = "token" link = "https://yourinstance.atlassian.net" LOGIN(user=user, password=password, url=link) if __name__ == '__main__': # the output of the file would be absolute to the directory # where this python file is being executed from # displayName of a user, to output multiple users separate by a comman # name = "Prince Nyeche,Prince,John Doe" name = "Prince Nyeche" USER.mention_user(name) ``` -------------------------------- ### GET /rest/agile/1.0/board/{board_id}/project Source: https://jiraone.readthedocs.io/en/latest/apis.html Returns all projects associated with a specific board. ```APIDOC ## GET /rest/agile/1.0/board/{board_id}/project ### Description Returns all projects that are associated with the board, for the given board ID. ### Method GET ### Endpoint /rest/agile/1.0/board/{board_id}/project ### Parameters #### Path Parameters - **board_id** (int) - Required - The ID of the board #### Query Parameters - **startAt** (int) - Optional - Pagination start index - **maxResults** (int) - Optional - Maximum number of results ``` -------------------------------- ### Example of Custom Method Arguments Source: https://jiraone.readthedocs.io/en/latest/apis.html Illustrates how to pass JSON or data payloads as keyword arguments to custom_method, which are then forwarded to the requests module. ```python json={"file": content} data={"file": content} ``` -------------------------------- ### Project Avatar Upload Headers Source: https://jiraone.readthedocs.io/en/latest/apis.html These are example headers for uploading a project avatar. 'X-Atlassian-Token: no-check' is often required for certain operations, and 'Content-Type' specifies the image format. ```text X-Atlassian-Token: no-check Content-Type: image/image type Valid image types are JPEG, GIF, or PNG. ``` -------------------------------- ### Authentication and Endpoint Access Source: https://jiraone.readthedocs.io/en/latest/_sources/apis.rst.txt How to authenticate with Jira and perform basic GET requests using the endpoint class. ```APIDOC ## GET /rest/api/3/priority ### Description Retrieves all priorities defined in the Jira instance. ### Method GET ### Endpoint endpoint.get_all_priorities() ### Request Example ```python from jiraone import LOGIN, endpoint LOGIN(user="email", password="token", url="https://yourinstance.atlassian.net") load = LOGIN.get(endpoint.get_all_priorities()) ``` ### Response #### Success Response (200) - **data** (object) - Returns a response object containing priority data. ``` -------------------------------- ### Get Projects on Board URL Construction Source: https://jiraone.readthedocs.io/en/latest/apis.html Shows the URL structure for retrieving projects associated with a specific board ID. ```python `/rest/api/3/board/{board_id}/project/search` ``` -------------------------------- ### Define Field Query Source: https://jiraone.readthedocs.io/en/latest/apis.html Example of setting the query parameter to filter for custom fields when retrieving Jira fields. ```python query = "type=custom" ``` -------------------------------- ### Get Project Roles Report Source: https://jiraone.readthedocs.io/en/latest/report.html Lists all projects and the users assigned to specific roles within those projects. ```python from jiraone import LOGIN, PROJECT user = "email" password = "token" link = "https://yourinstance.atlassian.net" LOGIN(user=user, password=password, url=link) if __name__ == '__main__': # the output of the file would be absolute to the # directory where this python file is being executed from PROJECT.get_all_roles_for_projects(pull="active", user_type="atlassian") ``` -------------------------------- ### GET /get_attachments_on_projects Source: https://jiraone.readthedocs.io/en/latest/apis.html Fetches all attachments for a project and writes them to a CSV file, including total size calculations. ```APIDOC ## GET /get_attachments_on_projects ### Description Fetches the list of all attachments for a project or projects and writes them to a CSV file. It also calculates the total size of attachments per issue and for all projects. ### Parameters #### Query Parameters - **attachment_folder** (str) - Optional - Target directory for the CSV file. - **attachment_file_name** (str) - Optional - Filename of the CSV. - **mode** (str) - Optional - Write mode (e.g., 'w' or 'a'). ``` -------------------------------- ### Get Project Roles URL Construction Source: https://jiraone.readthedocs.io/en/latest/apis.html Shows the URL pattern for fetching project roles associated with a given project ID or key. ```python `/rest/api/3/project/{id_or_key}/role` ``` -------------------------------- ### Get Fields Source: https://jiraone.readthedocs.io/en/latest/apis.html Returns a paginated list of fields for Classic Jira projects, with options to filter by query or system type. ```APIDOC ## GET /api/fields ### Description Returns a paginated list of fields for Classic Jira projects. The list can include: all fields, specific fields by defining id, fields that contain a string in the field name or description by defining query, or specific fields that contain a string in the field name or description by defining id and query. Only custom fields can be queried, type must be set to custom. Find system fields: Fields that cannot be added to the issue navigator are always returned. Fields that cannot be placed on an issue screen are always returned. Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking fields, subtasks, votes, and watches. For all other fields, this operation only returns the fields that the user has permission to view (i.e. The field is use, in at least one project that the user has Browse Projects project permission for.) ### Method GET ### Endpoint `/api/fields` ### Parameters #### Query Parameters - **query** (str | None) - Optional - accepted options -> string type=custom (use to search for custom fields) - **start_at** (int) - Optional - defaults to 0 - **max_results** (int) - Optional - defaults to 50 - **system** (str | None) - Optional - string accepts any string e.g. field (use any string to denote as system) ### Response #### Success Response (200) - **url** (str) - A string of the url ``` -------------------------------- ### Get Service Desk by ID URL Construction Source: https://jiraone.readthedocs.io/en/latest/apis.html Illustrates the URL for retrieving details of a specific service desk using its ID. ```python `/rest/servicedesk/1/servicedesk/{service_desk_id}` ``` -------------------------------- ### Get All Project Roles Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves all available roles within a project and the users assigned to each role. This is a static method that can be called directly on the class. ```python _static _get_all_roles_for_projects(_roles_folder ='Roles'_, _roles_file_name ='roles_file.csv'_, _user_extraction ='role_users.csv'_, _** kwargs_) ``` -------------------------------- ### LOGIN.from_jira Source: https://jiraone.readthedocs.io/en/latest/_sources/api.rst.txt Initializes the JiraOne authentication using an existing jira-python package instance. ```APIDOC ## LOGIN.from_jira ### Description Allows the ability to access jira's object methods, classes and properties by passing an instance of the jira object. Note: This currently only supports basic authentication. ### Parameters #### Request Body - **obj** (object) - Required - An instance of the JIRA object from the python jira package. ``` -------------------------------- ### POST /login Source: https://jiraone.readthedocs.io/en/latest/apis.html Initializes a session with a Jira instance using basic authentication credentials. ```APIDOC ## POST /login ### Description Initializes a login session for the JiraOne library using user email, API token, and instance URL. ### Method POST ### Parameters #### Request Body - **user** (str) - Required - The user email address. - **password** (str) - Required - The API token or password. - **url** (str) - Required - The base URL of the Jira instance. ### Request Example { "user": "email@example.com", "password": "token", "url": "https://yourinstance.atlassian.net" } ``` -------------------------------- ### Initialize Project Reporting Source: https://jiraone.readthedocs.io/en/latest/apis.html Import and initialize the PROJECT class from the `reporting` module to perform project reporting tasks and data extraction. ```python from jiraone import LOGIN, PROJECT ``` -------------------------------- ### Establish Custom Sessions Source: https://jiraone.readthedocs.io/en/latest/_sources/api.rst.txt Initialize and configure custom sessions using existing authentication credentials. ```python from jiraone import LOGIN, endpoint # previous login LOGIN.session.headers = LOGIN.headers LOGIN.session.auth = LOGIN.auth_request response = LOGIN.session.get(endpoint.myself()) print(response.status_code) # ``` ```python from jiraone import LOGIN, endpoint # previous login LOGIN.session.headers = LOGIN.headers LOGIN.session.auth = LOGIN.auth_request # not verifying SSL cert LOGIN.session.verify = False # setting a path to the certificate LOGIN.session.verify = "your_cert_path" response = LOGIN.session.get(endpoint.myself()) print(response.status_code) # ``` -------------------------------- ### Initialize JiraOne Login Source: https://jiraone.readthedocs.io/en/latest/_sources/apis.rst.txt Sets up the login credentials and URL for interacting with the Jira API. This is a prerequisite for most other operations. ```python from jiraone import LOGIN user = "email" password = "token" link = "https://yourinstance.atlassian.net" LOGIN(user=user, password=password, url=link) ``` -------------------------------- ### GET /rest/api/3/issue/{issueIdOrKey} Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieve details of a specific issue. ```APIDOC ## GET /rest/api/3/issue/{issueIdOrKey} ### Description Return the details of an issue. ### Method GET ### Endpoint /rest/api/3/issue/{issueIdOrKey} ### Parameters #### Path Parameters - **issueIdOrKey** (string) - Required - The ID or key of the issue. #### Query Parameters - **fields** (Array) - Optional - **properties** (Array) - Optional - **fieldsByKeys** (boolean) - Optional - **updateHistory** (boolean) - Optional - **expand** (string) - Optional ``` -------------------------------- ### POST /version Source: https://jiraone.readthedocs.io/en/latest/apis.html Creates a new project version. ```APIDOC ## POST /version ### Description Creates a version. ### Request Body - **archived** (bool) - Optional - **expand** (str) - Optional - **description** (str) - Optional - **id** (str) - Optional - **issueStatusForFixVersion** (VersionIssueStatus) - Optional ``` -------------------------------- ### GET /organization Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves details of a specific organization by ID. ```APIDOC ## GET /organization ### Description Returns details of an organization. Use this method to get organization details whenever your application component is passed an organization ID but needs to display other organization details. ### Method GET ### Parameters #### Path Parameters - **org_id** (int) - Required - The ID of the organization. ``` -------------------------------- ### GET /find_user Source: https://jiraone.readthedocs.io/en/latest/apis.html Finds a specific user based on a search query. ```APIDOC ## GET /find_user ### Description Finds a specific user. ### Method GET ### Parameters #### Query Parameters - **query** (str) - Required - A search term (email, displayname, or accountId) - **source** (List) - Optional - A list of users to search within ### Response - **Returns** (Dict | List) - A dict of the user data or a list of the data ``` -------------------------------- ### Backup API Source: https://jiraone.readthedocs.io/en/latest/apis.html Initiates a backup process for the environment. ```APIDOC ## POST /api/backup ### Description Runs a backup process for the environment. ### Method POST ### Endpoint /api/backup ### Request Example ```json { "cbAttachments": "false", "exportToCloud": "true" } ``` * Changing `"cbAttachments"` to `"true"` will enable backup with attachments. ``` -------------------------------- ### Get My Own User Data Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves data for the currently authenticated user. ```APIDOC ## GET /rest/api/3/myself ### Description Returns data about the currently authenticated user. ### Method GET ### Endpoint /rest/api/3/myself ### Response #### Success Response (200) - **string** (str) - A string of the URL related to the user data. #### Response Example ```json { "self": "...", "accountId": "...", "emailAddress": "..." } ``` ``` -------------------------------- ### GET /sd/organizations Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves a list of all organizations associated with a service desk. ```APIDOC ## GET /sd/organizations ### Description This method returns a list of all organizations associated with a service desk. ### Parameters #### Query Parameters - **service_desk_id** (int) - Required - The ID of the service desk. - **start** (int) - Optional - Pagination start index, defaults to 0. - **limit** (int) - Optional - Pagination limit, defaults to 50. - **account_id** (str) - Optional - The account ID of the user. ### Response #### Success Response (200) - **url** (str) - A string of the URL. ``` -------------------------------- ### Get Dashboard by ID Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves a specific dashboard using its ID. ```APIDOC ## GET /api/dashboards/{dashboard_id} ### Description Gets the dashboard. ### Method GET ### Endpoint `/api/dashboards/{dashboard_id}` ### Parameters #### Path Parameters - **dashboard_id** (int) - An id for the dashboard ### Response #### Success Response (200) - **url** (str) - A string of the url ``` -------------------------------- ### Initialize LOGIN with OAuth Credentials Source: https://jiraone.readthedocs.io/en/latest/apis.html Initializes the LOGIN class using OAuth 2.0 3LO. Requires a client dictionary containing client ID, secret, name, and callback URL. The 'name' key is optional if targeting a single instance. ```python client = { "client_id": "JixkXXX", "client_secret": "KmnlXXXX", "name": "nexusfive", "callback_url": "https://auth.atlassian.com/XXXXX" } from jiraone import LOGIN # previous expression LOGIN(oauth=client) ``` -------------------------------- ### Initialize Login for Issue History Source: https://jiraone.readthedocs.io/en/latest/report.html Sets up the login credentials for extracting issue history, with an option to disable API mode for Server instances. ```python from jiraone import LOGIN, PROJECT user = "email" password = "token" link = "https://yourinstance.atlassian.net" LOGIN(user=user, password=password, url=link) ``` -------------------------------- ### GET _view_issues Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves all issues and their properties based on project or issue identifiers. ```APIDOC ## GET _view_issues ### Description View all issues and its properties. ### Parameters #### Query Parameters - **project_key_or_id** (str|int) - Optional - The project key or ID. - **key_or_id** (str|int) - Optional - The specific issue key or ID. ``` -------------------------------- ### GET /user/permission Source: https://jiraone.readthedocs.io/en/latest/apis.html Returns the set of permissions for managing a specified Atlassian account. ```APIDOC ## GET /user/permission ### Description Returns the set of permissions you have for managing the specified Atlassian account. ### Method GET ### Parameters #### Query Parameters - **account_id** (str) - Required - A user string value for Atlassian accounts - **query** (list) - Optional - A query parameter of Array (profile, profile.write, profile.read, email.set, lifecycle.enablement, apiToken.read, apiToken.delete) ``` -------------------------------- ### Save and Load OAuth Token Source: https://jiraone.readthedocs.io/en/latest/apis.html Demonstrates how to save the OAuth token dictionary as a string for storage (e.g., in a database or file) and how to load it back. ```python # Example for storing the OAuth token dumps = LOGIN.save_oauth # this is a property value which contains a # dict of tokens in strings # As long as a handshake has been allowed with OAuth, # the above should exist. LOGIN.save_oauth = f"{json.dumps(dumps)}" # with the above string, you can easily save your # OAuth tokens into a DB or file. ``` -------------------------------- ### GET /search_field Source: https://jiraone.readthedocs.io/en/latest/apis.html Searches for custom or system field definitions within Jira. ```APIDOC ## GET /search_field ### Description Searches for custom fields or system fields by name. ### Method GET ### Parameters #### Query Parameters - **find_field** (str) - Optional - The field name to search for. ``` -------------------------------- ### GET /organizations Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves a list of organizations in the Jira Service Management instance. ```APIDOC ## GET /organizations ### Description Returns a list of organizations in the Jira Service Management instance. Use this method when you want to present a list of organizations or want to locate an organization by name. ### Method GET ### Parameters #### Query Parameters - **start** (int) - Optional - Defaults to 0 - **limit** (int) - Optional - Defaults to 50 - **account_id** (str) - Optional - The account ID string. ``` -------------------------------- ### Run Jira Backup Source: https://jiraone.readthedocs.io/en/latest/apis.html Initiates a backup process for the Jira environment. Set 'cbAttachments' to 'true' to include attachments in the backup. ```python # send a POST request with the payload payload_data = {"cbAttachments": "false", "exportToCloud": "true"} # changing “cbAttachments” to “true” will enable backup with attachments ``` -------------------------------- ### Initialize JiraOne Authentication Source: https://jiraone.readthedocs.io/en/latest/_sources/api.rst.txt Authenticate with an Atlassian instance using email and API token. ```python from jiraone import LOGIN, endpoint user = "email" password = "token" link = "https://yourinstance.atlassian.net" LOGIN(user=user, password=password, url=link) def priorities(): load = LOGIN.get(endpoint.get_all_priorities()) if load.status_code == 200: # some expression here ... ``` ```python from jiraone import LOGIN user = "email" password = "token" link = "https://yourinstance.atlassian.net" LOGIN(user=user, password=password, url=link) ``` -------------------------------- ### Manage custom sessions Source: https://jiraone.readthedocs.io/en/latest/api.html Establish and configure additional sessions using existing authentication headers. ```python from jiraone import LOGIN, endpoint # previous login LOGIN.session.headers = LOGIN.headers LOGIN.session.auth = LOGIN.auth_request response = LOGIN.session.get(endpoint.myself()) print(response.status_code) # ``` ```python from jiraone import LOGIN, endpoint # previous login LOGIN.session.headers = LOGIN.headers LOGIN.session.auth = LOGIN.auth_request # not verifying SSL cert LOGIN.session.verify = False # setting a path to the certificate LOGIN.session.verify = "your_cert_path" response = LOGIN.session.get(endpoint.myself()) print(response.status_code) ``` -------------------------------- ### GET _issue_count Source: https://jiraone.readthedocs.io/en/latest/apis.html Returns the total count of issues based on a provided JQL query. ```APIDOC ## GET _issue_count ### Description Returns the total count of issues within a JQL search phrase. ### Parameters #### Query Parameters - **jql** (str) - Required - A valid JQL query. ### Response #### Success Response (200) - **issue_count** (int) - The total number of issues found. - **max_page** (int) - The maximum page number available. ``` -------------------------------- ### Dictionary Indexing with __dictionary__() Source: https://jiraone.readthedocs.io/en/latest/_sources/api.rst.txt Demonstrates how to use the `__dictionary__()` method for indexing dictionary objects within the JiraOne library. ```APIDOC ## `__dictionary__()` Method ### Description This method is used for indexing dictionary objects, behaving similarly to standard iteration. ### Method `__dictionary__()` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from jiraone import For diction = {1: 4, "hello": "hi", "value": True, "why": False} d = For(diction).__dictionary__(2) # calls the 3rd item in the list # output # {"value": True} ``` ### Response #### Success Response (200) Returns the indexed dictionary item. #### Response Example ```json { "example": "{\"value\": True}" } ``` ``` -------------------------------- ### GET /get_total_comments_on_issues Source: https://jiraone.readthedocs.io/en/latest/apis.html Generates a report on the number of comments per issue and per reporter. ```APIDOC ## GET /get_total_comments_on_issues ### Description Returns a report with the number of comments sent to or by a reporter, including total counts per issue. ### Parameters #### Query Parameters - **folder** (str) - Optional - The name of a folder. - **file_name** (str) - Optional - The name of a file. ``` -------------------------------- ### GET /organization Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves organization information, including users, domains, events, and policies. ```APIDOC ## GET /organization ### Description Returns a list of organizations or specific details based on the provided filter. ### Method GET ### Parameters #### Query Parameters - **org_id** (str) - Optional - Retrieve the organization id from the API key - **domain_id** (str) - Optional - Retrieve domain details - **filter_by** (str) - Optional - Determines the endpoint to return (users, domains, events, policies) - **event_id** (str) - Optional - Use to determine the events in the audit log - **action** (bool) - Optional - Additional positional argument for events (default: True) - **policy_id** (str) - Optional - An id of the policy ``` -------------------------------- ### POST /organization Source: https://jiraone.readthedocs.io/en/latest/apis.html Creates a new organization. ```APIDOC ## POST /organization ### Description Creates an organization by passing the name of the organization. ### Method POST ### Request Body - **name** (string) - Required - The name of the organization. ### Response #### Success Response (200) - **url** (string) - The URL of the created organization. ``` -------------------------------- ### GET /get_field_value Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves the current value of a specific field for a given Jira issue. ```APIDOC ## GET /get_field_value ### Description Returns the value of a specific field on a Jira issue. ### Method GET ### Parameters #### Query Parameters - **name** (str) - Required - The name of the field. - **keys** (str/int) - Required - The issue key or issue ID. ``` -------------------------------- ### Initialize LOGIN from JIRA Object Source: https://jiraone.readthedocs.io/en/latest/apis.html Performs login initialization using an existing JIRA object from the 'jira' Python package. It leverages basic authentication and returns the authenticated JIRA object, allowing simultaneous use of both packages. ```python from jira import JIRA from jiraone import LOGIN, endpoint my_jira = JIRA(server="https://nexusfive.atlassian.net", basic_auth=("prince@example.com", "MXKSlsXXXXX")) LOGIN.from_jira(my_jira) print(LOGIN.get(endpoint.myself())) # response # ``` -------------------------------- ### Map Project Keys to Workflow Schemes Source: https://jiraone.readthedocs.io/en/latest/apis.html Specify workflow schemes for project keys to ensure correct mapping on the destination instance. ```python # previous expression # Where ITSEC is the project key workflow = {"ITSEC":"Software Simplified Workflow Scheme"} PROJECT.export_issues(jql=jql, extension="json", workflows=workflow) ``` -------------------------------- ### GET /rest/api/3/project/{id_or_key}/role Source: https://jiraone.readthedocs.io/en/latest/apis.html Returns a list of project roles for a specific project. ```APIDOC ## GET /rest/api/3/project/{id_or_key}/role ### Description Returns a list of project roles for the project returning the name and self URL for each role. ### Method GET ### Endpoint /rest/api/3/project/{id_or_key}/role ### Parameters #### Path Parameters - **id_or_key** (str/int) - Required - An issue key or id ``` -------------------------------- ### GET /get_organization Source: https://jiraone.readthedocs.io/en/latest/_sources/api.rst.txt Retrieves organization-level data including users, domains, policies, and events. ```APIDOC ## GET /get_organization ### Description Returns organization users, domains, policies, and events based on the filter_by argument. ### Method GET ### Parameters #### Query Parameters - **filter_by** (string) - Required - Options: 'users', 'domains', 'policies', 'events'. - **action** (boolean) - Optional - If set to True with filter_by='events', returns event actions instead of a list of events. - **policy_id** (string) - Optional - Used when filter_by='policies' to fetch specific policy data. ### Response #### Success Response (204) - **data** (object) - Organization data based on the requested filter. ``` -------------------------------- ### GET /custom_request Source: https://jiraone.readthedocs.io/en/latest/apis.html Performs a generic HTTP request to a specified URL using the authenticated session. ```APIDOC ## [HTTP_METHOD] [URL] ### Description Executes a custom HTTP request (GET, POST, PUT, DELETE, etc.) to a target URL using the active session. ### Method Dynamic (GET, POST, PUT, DELETE, etc.) ### Parameters #### Path Parameters - **url** (str) - Required - The target URL to query. #### Request Body - **kwargs** (dict) - Optional - Additional keyword arguments for the requests module (e.g., json, data). ### Response #### Success Response (200) - **Response** (Object) - An HTTP response object. ``` -------------------------------- ### Get Resolutions URL Construction Source: https://jiraone.readthedocs.io/en/latest/apis.html Provides the URL for retrieving all issue resolution values in Jira. ```python `/rest/api/3/resolution` ``` -------------------------------- ### Configure Custom SSL Certificates Source: https://jiraone.readthedocs.io/en/latest/_sources/api.rst.txt Set a custom path for SSL certificates using environment variables before initiating requests. ```python import os your_cert_path = "direct_absolute_path/to/cert" os.environ["REQUESTS_CA_BUNDLE"] = your_cert_path # before calling jiraone statements ``` -------------------------------- ### Get Issue Search Payload Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves a dictionary object containing arguments for the `endpoint.search_cloud_issues` method. ```APIDOC ## GET /api/issues/search/payload ### Description Returns a dict object of the `endpoint.search_cloud_issues` arguments. ### Method GET ### Endpoint `/api/issues/search/payload` ### Response #### Success Response (200) - **payload** (dict) - A dictionary object of the `endpoint.search_cloud_issues` arguments ``` -------------------------------- ### Get Board by ID Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves a specific board by its ID. Access is restricted by user permissions. ```APIDOC ## GET /api/boards/{board_id} ### Description Returns the board for the given board ID. This board will only be returned if the user has permission to view it. Admins without the view permission will see the board as a private one, so will see only a subset of the board’s data (board location for instance). ### Method GET ### Endpoint `/api/boards/{board_id}` ### Parameters #### Path Parameters - **board_id** (int) - Required - A board id ### Response #### Success Response (200) - **url** (str) - A string of the url ``` -------------------------------- ### Create Jira Project Component Source: https://jiraone.readthedocs.io/en/latest/apis.html Use this POST request to create a new component within a Jira project. Ensure all required body parameters are correctly formatted. ```python body = { "assigneeType": "PROJECT_LEAD", "description": "This is a Jira component", "isAssigneeTypeValid": false, "leadAccountId": "5b10a2844cxxxxxx700ede21g", "name": "Component 1", "project": "BAC" } ``` -------------------------------- ### GET/POST/PUT/DELETE /rest/api/3/comment Source: https://jiraone.readthedocs.io/en/latest/apis.html Create, update, delete, or get comments for an issue. Supports pagination and filtering. ```APIDOC ## GET/POST/PUT/DELETE /rest/api/3/comment ### Description Create, update, delete, or get a comment. This endpoint can be used to retrieve a paginated list of comments for an issue, add a new comment, update an existing one, or delete a comment. ### Method GET, POST, PUT, DELETE ### Endpoint /rest/api/3/comment ### Parameters #### Path Parameters None #### Query Parameters - **query** (string | None) - Used for filtering comments. - **key_or_id** (string | int | None) - Required for POST, PUT, DELETE. The key or ID of the issue or comment. - **start_at** (int) - Optional - The starting index for pagination. Defaults to 0. - **max_results** (int) - Optional - The maximum number of results to return. Defaults to 50. - **orderBy** (string) - Optional - Specifies the order of results. Valid values: created, -created, +created. - **event** (boolean) - Optional - Set to true to include event information. - **expand** (string) - Optional - Specifies additional fields to include in the response. Available options: renderedBody, properties. #### Request Body **For POST (Add Comment):** - **body** (Anything) - Required - The content of the comment. - **visibility** (object) - Optional - The group or role to which this comment is visible. - **properties** (Array) - Optional - A list of comment properties. **For PUT (Update Comment):** - **ids** (Array) - Required - The ID of the comment to update. - **body** (Anything) - Required - The updated content of the comment. **For POST (Get comments by IDs):** - **ids** (Array) - Required - The list of comment IDs. A maximum of 1000 IDs can be specified. ### Request Example **Add Comment (POST):** ```json { "body": "This is a test comment.", "visibility": { "type": "group", "value": "jira-users" } } ``` **Get Comments by IDs (POST):** ```json { "ids": [10001, 10002] } ``` ### Response #### Success Response (200, 201, 204) - **Comments** (Array) - A list of comments (for GET requests). - **Comment** (Object) - A single comment object (for GET request with specific ID). - **Success Status** (201 for POST, 204 for PUT/DELETE) - Indicates successful operation. #### Response Example **Get Comments (GET):** ```json { "comments": [ { "id": "10001", "author": { "displayName": "John Doe" }, "body": { "content": "This is a comment." }, "created": "2023-01-01T10:00:00.000+0000" } ] } ``` ``` -------------------------------- ### jiraone.utils.create_urls Source: https://jiraone.readthedocs.io/en/latest/apis.html Dynamically generates a URL pattern based on user-supplied arguments, mirroring the structure of endpoint.search_cloud_issues. ```APIDOC ## POST /api/jiraone/utils/create_urls ### Description Dynamically generate a URL pattern based on user supplied arguments. It follows the same argument structure as `endpoint.search_cloud_issues`. ### Method POST ### Endpoint /api/jiraone/utils/create_urls ### Parameters #### Request Body - **kwargs** (dict) - Required - Keyword arguments. Acceptable arguments include: method (string: "GET" or "POST"), fields (list[str]), expand (str), properties (list[str]), fields_by_keys (bool), fail_fast (bool), reconcile_issues (list[int]), max_results (int), query (str), next_page (str). ### Response #### Success Response (200) - **url_pattern** (str) - A URL pattern based on user supplied arguments. #### Response Example ```json { "url_pattern": "https://your-domain.atlassian.net/rest/api/3/search?jql=project%20%3D%20IT" } ``` ``` -------------------------------- ### Jira Status Report Output Format Source: https://jiraone.readthedocs.io/en/latest/_sources/report.rst.txt Example of the JSON structure returned when generating a time-in-status report. ```json [ { "author": "Prince Nyeche", "issueKey": "COM-12", "status": "To Do", "summary": "Workflow test 3", "timeStatus": "0h 00m 19s" }, { "author": "Prince Nyeche", "issueKey": "COM-14", "status": "In Progress", "summary": "Workflow test 3", "timeStatus": "8d 6h 32m 52s" } ] ``` -------------------------------- ### Configure Bearer Authentication Source: https://jiraone.readthedocs.io/en/latest/_sources/api.rst.txt Set up token-based authentication with custom authorization prefixes. ```python from jiraone import LOGIN, endpoint # previous statement url = "https://nexusfive.atlassian.net" token = "GHxxxxxPPPxx" # First assign a base_url to the attribute below LOGIN.base_url = url # You need to pass the token variable to a keyword argument called `sess` LOGIN.token_session(sess=token) ``` ```python from jiraone import LOGIN # previous expression LOGIN.token_session(sess=token, _type="JWT") ``` -------------------------------- ### Authenticate with JiraOne using jira-python Source: https://jiraone.readthedocs.io/en/latest/_sources/api.rst.txt Integrates an existing jira-python object with JiraOne. Currently limited to basic authentication. ```python from jira import JIRA from jiraone import LOGIN, endpoint my_jira = JIRA(server="https://nexusfive.atlassian.net", basic_auth=("prince@example.com", "MXKSlsXXXXX")) LOGIN.from_jira(my_jira) print(LOGIN.get(endpoint.myself())) # response # ``` -------------------------------- ### Fetch Project Attachments Source: https://jiraone.readthedocs.io/en/latest/apis.html Fetches a list of all attachments for specified projects and writes them to a CSV file. It calculates the total size of attachments. The 'mode' parameter controls file writing behavior (e.g., 'w' for overwrite, 'a' for append). ```python get_attachments_on_projects(_attachment_folder ='Attachment'_, _attachment_file_name ='attachment_file.csv'_, _mode ='w'_, _** kwargs_) ``` -------------------------------- ### GET /service_desks Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves all service desks in the Jira Service Management instance that the user has permission to access. ```APIDOC ## GET /service_desks ### Description Returns all service desks the user has permission to access. Useful for listing or locating service desks by name or keyword. ### Parameters #### Query Parameters - **start** (int) - Optional - Pagination row. - **limit** (int) - Optional - Limit to each pagination. ### Response #### Success Response (200) - **url** (str) - A string of the URL. ``` -------------------------------- ### Get Customers for Service Desk Source: https://jiraone.readthedocs.io/en/latest/apis.html Retrieves a list of customers for a given service desk, with optional filtering. ```APIDOC ## GET /api/service_desks/{service_desk_id}/customers ### Description This method returns a list of the customers on a service desk. The returned list of customers can be filtered using the query parameter. The parameter is matched against customers’ displayName, name, or email. This API is experimental. ### Method GET ### Endpoint `/api/service_desks/{service_desk_id}/customers` ### Parameters #### Path Parameters - **service_desk_id** (int) - Required #### Query Parameters - **start** (int) - Optional - defaults to 0 - **limit** (int) - Optional - defaults to 50 - **query** (str | None) - Optional - datatype string. ### Response #### Success Response (200) - **url** (str) - A string of the url ``` -------------------------------- ### Login to Jira Instance Source: https://jiraone.readthedocs.io/en/latest/report.html Logs into a Jira instance using provided credentials. Set `api=False` to extract issue history from a server instance. ```python LOGIN(user=user, password=password, url=link) ``` -------------------------------- ### Generate Project Access Report Source: https://jiraone.readthedocs.io/en/latest/_sources/report.rst.txt Lists users who have BROWSE permission for projects on the instance. ```python from jiraone import LOGIN, PROJECT user = "email" password = "token" link = "https://yourinstance.atlassian.net" LOGIN(user=user, password=password, url=link) if __name__ == '__main__': # the output of the file would be absolute to the directory where this python # file is being executed from PROJECT.projects_accessible_by_users("expand=insight,description", "searchBy=key,name", permission="BROWSE", pull="active", user_type="atlassian") ``` -------------------------------- ### Format and print data with echo Source: https://jiraone.readthedocs.io/en/latest/_sources/api.rst.txt Uses the PrettyPrint class to format and display objects. ```python from jiraone import echo data = "hello world" echo(data) # prints // # 'hello world' ``` -------------------------------- ### POST /sprint Source: https://jiraone.readthedocs.io/en/latest/apis.html Creates a future sprint. ```APIDOC ## POST /sprint ### Description Creates a future sprint. Sprint name and origin board id are required. Start date, end date, and goal are optional. ### Method POST ### Request Body - **name** (string) - Required - **originBoardId** (integer) - Required - **startDate** (string) - Optional - **endDate** (string) - Optional - **goal** (string) - Optional ### Response #### Success Response (200) - **url** (string) - The URL of the created sprint. ``` -------------------------------- ### Iterate Over String Data Source: https://jiraone.readthedocs.io/en/latest/apis.html Use the For class to get a list of characters from a string. This can be applied to various data structures. ```python from jiraone import For data = "Summary" result = For(data) print(list(result)) ``` -------------------------------- ### Initialize Token Session Source: https://jiraone.readthedocs.io/en/latest/apis.html Initialize an HTTP request session using an email and token, or a session string. The authorization type can be specified, defaulting to 'Bearer'. ```python token_session(_email =None_, _token =None_, _sess =None_, __type ='Bearer'_) ```