Package: jirasession
JirasessionA light weight library to interact with the Jira APIDocumentationjirasessionjirasession.sessionjirasession.session.JiraSessionJiraSession.initJiraSession._resolverJiraSession.account_infoJiraSession.add_attachmentJiraSession.add_commentJiraSession.assign_issueJiraSession.assign_to_meJiraSession.create_issueJiraSession.delete_issueJiraSession.get_all_commentsJiraSession.get_commentsJiraSession.get_issueJiraSession.get_issues_from_projectJiraSession.get_jira_userJiraSession.get_project_issuetypesJiraSession.get_transitions_from_issueJiraSession.jira_priorities_listJiraSession.link_issuesJiraSession.link_typesJiraSession.searchJiraSession.track_issue_timeJiraSession.transition_issueJiraSession.update_issuejirasession.userjirasession.user.JiraUserJiraUser.initJiraUser.account_informationjirasessionDocumentation for the JiraSession and JiraUser objectsjirasession.sessionjirasession.session.JiraSession(self, username: str, token: str, server: str, session: requests.sessions.Session = None, max_retries: int = 3, pool_connections: int = 16, pool_maxsize: int = 16, resolve_status_codes: list = [200, 201, 204])JiraSession object can be imported from jirasession.session or from jirasessionJiraSession.__init__(self, username: str, token: str, server: str, session: requests.sessions.Session = None, max_retries: int = 3, pool_connections: int = 16, pool_maxsize: int = 16, resolve_status_codes: list = [200, 201, 204])Initialization of JiraSessionJiraSession._resolver(self, request: functools.partial) -> requests.models.Responseattempt to resolve a bad requests
don't call this method aloneJiraSession.account_info(self) -> requests.models.Responseget jira accountid from current auth creds

    return {int} -- accountid or NoneJiraSession.add_attachment(self, issue_key: str, filepath: str) -> requests.models.Responseadd an attachment to an issue

    issue_key {str} -- id or key of issue to add attachment
    filepath {str} -- path to file to use as attachment

    return {requests.Response} -- response from attachment routeJiraSession.add_comment(self, issue_key: str, comment: str) -> requests.models.Responseadd a new comment to a issue

    issue_key {str} -- issue key to pull available transitions from
    comment {str} -- string to add as comment

    return {requests.Response} -- response from post to comment routeJiraSession.assign_issue(self, issue_key: str, accountid: str) -> requests.models.Responseassign a issue to the current user accountid

    issue_key {str} -- newly created issue keyJiraSession.assign_to_me(self, issue_key: str) -> requests.models.Responseassign to yourself based on jirauser.userid
    issue {str} -- issue key to assign to yourselfJiraSession.create_issue(self, content: dict) -> requests.models.Responsecreate a new issue

    content {dict} -- dictionary of issue content

    return {requests.Response} -- response from postJiraSession.delete_issue(self, issue_key: str, delete_subtasks: bool = False) -> requests.models.Responsedelete and issue by id

    issue_key {str} -- key of issue to delete

    return {requests.Response} -- response from deleteJiraSession.get_all_comments(self, issue_key: str, orderby: str = 'created', expand: bool = False) -> listget all comments from an issueissue_key {str} -- issue key to get comments for
    orderby {str} -- order comments by created date, other options [-created, +created]
    expand {bool} -- if true, renderBody will be sent to get comments rendered in html

    return {list} -- return list of comments from issueJiraSession.get_comments(self, issue_key: str, start: int = 0, maxresults: int = 50, orderby: str = 'created', expand: bool = False) -> requests.models.Responseget comments from an issueissue_key {str} -- issue key to get comments for
    start {int} -- start index for retrieval
    maxresults {int} -- max number of comments to retrieve [default: 50]
    orderby {str} -- order comments by created date, other options [-created, +created]
    expand {bool} -- if true, renderBody will be sent to get comments rendered in html

    return {requests.Response} -- response from comments routeJiraSession.get_issue(self, issue_key: str, fields: list = ['*all'], expand: dict = {}) -> requests.models.Responseget jira issue by id

    issue_key {str} -- key of issue to get
    fields {list} -- fields to retrieve, add a '-' to a field to remove it. Default: *all
    expand {dict} -- custom expand for search, use jira api docs to further expand

    return {requests.Response} -- response from issue route (GET)JiraSession.get_issues_from_project(self, project_key: str, maxresults: int = None) -> listretrieve all issues from a given project id
    project_key {str} -- project key, example: DEV
    maxresults {int} -- max number of results

    return {list} -- issuesJiraSession.get_jira_user(self, username: Union[str, list]) -> requests.models.Responseget user information for jira users by usernames

    username {Union[str, list]} -- a username or list of usernames

    return {requests.Response} -- the response from the user bulk routeJiraSession.get_project_issuetypes(self, project_key: str) -> listget the available issue types for a project

    project_key {str} -- key for project

    return {list} -- issuetypes found for the given projectJiraSession.get_transitions_from_issue(self, issue_key: str) -> requests.models.Responseget the available transitions for a issue

    issue_key {str} -- issue key to pull available transitions from

    return {requests.Response} -- response from get to transitions routeJiraSession.jira_priorities_list(self) -> listget the available priorities for a project

    project_key {str} -- key for project

    return {list} -- priorities found for the given projectJiraSession.link_issues(self, in_issue_key: str, out_issue_key: str, link_type: str = 'relates to', comment: dict = None) -> requests.models.Responselink two issues together, in and out will relate to jira api route but has no effect on functionalityin_issue_key {str} -- the issue to link from
    out_issue_key {str} -- the issue to link to
    link_type {str] -- type of link, default: Relates To
    comment {dict} [optional] -- comment for linking of issues
    
    return {requests.Response} -- response from issuelink routeJiraSession.link_types(self) -> requests.models.Responseretrieve the link types for jira issues

    return {requests.Response} -- response from issueLinkType routeJiraSession.search(self, jql: str, start: int = 0, maxresults: int = 50, fields: list = ['*all'], validate: bool = True, validate_level: str = 'strict', expand: dict = {}) -> requests.models.Responsesearch jira using a jql statement
    jql {str} -- jql string to search and validate if chosen
    start {int} -- start index
    maxresults {int} -- max number of results per page
    fields {list} -- fields to retrieve, add a '-' to a field to remove it. Default: *all
    validate {bool} -- to validate jql string upon search
    validate_level {str} -- validation level: strict, warn, none. Default: strict
    expand {dict} -- custom expand for search, use jira api docs to further expand

    return {requests.Response} -- response from search route (POST)JiraSession.track_issue_time(self, issue_key: str, time_spent: str) -> requests.models.Responseadd time for time tracking application for a issue

    issue_key {str} -- issue key to pull available transitions from
    time_spent {str} -- jira format time. ex: 1d 2h 3m

    return {requests.Response} -- response from post to worklog routeJiraSession.transition_issue(self, issue_key: str, transition_state_id: str) -> requests.models.Responsetransition a issue to a new state by id

    issue_key {str} -- issue key to pull available transitions from
    transition_state_id {str} -- new transition state id

    return {requests.Response} -- response from post to transitions routeJiraSession.update_issue(self, issue_key: str, content: dict) -> requests.models.Responseupdate an issue by id

    issue_key {str} -- key of issue to update
    content {dict} -- dictionary of issue content

    return {requests.Response} -- response from putjirasession.userjirasession.user.JiraUser(self, username: str = None, token: str = None, server: str = None)An authenticated Jira userJiraUser.__init__(self, username: str = None, token: str = None, server: str = None)a JiraUser object that contains information for the authenticated userusername {str} -- username for jira account
    token {str} -- api token for jira account
    server {str} -- server to build rest url fromJiraUser.account_information(self) -> requests.models.Responseget account information for jira account from username and tokenreturn {requests.Response} response from myself routeBasic examplefromjirasessionimportJiraSessionsession=JiraSession('email','token','https://server.atlassian.net/')new_isssue={'project':{'key':'DEV'},'summary':'test','description':'test','issuetype':{'name':'Ticket'}}resp=session.create_issue(new_isssue)ifresp.status_code==200:print('issue created')# handle requests.Response to get issue informationelse:print('error creating issue')# debug requests.Response here