Modules for interacting with Atlassian products.
Project description
Prerequisites
from atlassian_modules import JiraHelper
Getting Started
Connectivity to Atlassian Jira
To initialize a connection to Jira, instantiate the JiraHelper
class with your Jira URL, email, and API token:
jira_helper = JiraHelper(JIRA_URL, EMAIL, API_TOKEN)
Atlassian Jira
1. Create a Jira Ticket
- You can create a new Jira ticket using the
create_ticket
method:
jira_helper.create_ticket("XX", "Test Issue", "This is a test issue created from main.py", "Task")
Parameters:
project_key
: The key of the project in which the ticket should be created.summary
: A brief summary of the issue.description
: A detailed description of the issue.issue_type
: The type of the issue (e.g., "Task", "Bug", etc.).
Output:
https://your-url/browse/XX-1234
2. Delete a Jira Ticket
- To delete a ticket, use the
delete_ticket
method:
jira_helper.delete_ticket("XX-1234")
Parameter:
ticket_key
: The unique key of the ticket you want to delete.
Output:
True
: SuccessFalse
: Failure
3. Transition a Jira Ticket
- To transition a ticket to a different status, use the
transition_ticket
method:
test = jira_helper.transition_ticket("XX-1234", "In Progress")
print(test)
# or
test = jira_helper.transition_ticket("XX-1234", 31)
print(test)
Parameters:
ticket_key
: The unique key of the ticket you want to transition.transition_name
: The name of the transition you want to apply. This is not a case-sensitive when you apply the transition name.
Output:
True
: SuccessFalse
: Failure
4. If exist a Jira Ticket
- To check if a ticket exist, use the
if_exist_ticket
method:
test = jira_helper.if_exist_ticket("XX-1234")
print(test)
Parameters:
ticket_key
: The unique key of the ticket you want to check that exist.
Output:
True
: SuccessFalse
: Failure
5. Comment on a Jira ticket
- To comment on the ticket, use the
comment_ticket
method:
test = jira_helper.comment_ticket("XX-1234","test")
print(test)
Parameters:
ticket_key
: The unique key of the ticket you want to comment.comment_text
: The text comment you want to post to the Jira ticket.
Output:
6. Pass the JQL and get the ticket array
- To query tickets using JQL, use the
jql_ticket
method:
test = jira_helper.jql_ticket('project = "PRJ" and status = Triage and type != Epic')
print(test)
# It returns all tickets
test = jira_helper.jql_ticket('project = "PRJ" and status = Triage and type != Epic', 5)
print(test)
# It returns 5 tickets
Parameters:
jql_query
: Working JQL Query.max_results
: Optional. Returns everything is passed nothing
Output:
['XX-1234','XX-1235']...
Data Privacy Note
🔒 We respect your privacy: This module does not store any of your data anywhere. It simply interacts with the Atlassian Jira API to perform the requested operations. Ensure you manage your connection details securely.
Future Developments
In upcoming releases, I am working to add below functions...
- add story point parameter in
create_ticket
function change_ticket_type
to change the issue type like from Task to Bug
Please keep an eye on the repository's release notes for the latest updates and feature rollouts.
Release Notes
Release 0.1.4 (18 Sep 2023)
- Suppressed extra output and focused on specific output of functions for smoother integration.
- Updated the
README.md
with output details. - Search a ticket
if_exist_ticket
. - Comment on a ticket
comment_ticket
. - Pass the JQL
jql_ticket
.
Release 0.1.3 (18 Sep 2023)
- Deleted due to potential bug.
Release 0.1.2.1 (16 Sep 2023)
- Updated the
README.md
format.
Release 0.1.2 (16 Sep 2023)
- Check Jira ticket exist
if_exist_ticket
added. - Updated the
README.md
format.
Release 0.1.1 (16 Sep 2023)
- Transition a Jira ticket (Can pass transition ID too)
transition_ticket
. - Modified
README.md
for clarity use of this module.
Release 0.1 (16 Sep 2023)
- Create a Jira ticket
create_ticket
. - Delete a Jira ticket
delete_ticket
. - Transition a Jira ticket (Strict to Transition Name)
transition_ticket
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for atlassian_modules-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9b82f288f6b02d5e3fc34ad55fa5496b718032f4ee7c8883eab224e30a963a9 |
|
MD5 | cb1e5fce76ce15d3067e7ccb31299551 |
|
BLAKE2b-256 | c8b3158d4094abe1e3fa532baeea0be6412b497b515509f870f791ba7f08bc0b |