Sign in

Jira tasks

There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
  1. 1

    Create a JIRA ticket

    There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
    from jira import JIRA creds = _get_creds(cred_label)['creds'] username = creds['username'] api_key = creds['password'] myjira = None issue_id = "" if username and api_key and jira_server: myjira = JIRA( server=jira_server, basic_auth=(username, api_key) ) else: _problem = True msg = "Missing username or API key" print(msg) if myjira: issue_dict = { "project" : project, "summary" : summary, "description" : description, "issuetype" : {"name" : "Task"} } new_issue = myjira.create_issue(fields=issue_dict) issue_id = new_issue.key print(issue_id)
    copied
    1
  2. 2

    Process Jira Ticket

    There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
    import json print("Ticket: ", json.dumps(ticket, indent=4)) fields = ticket.get("fields", {}) issue_id = ticket['key']
    copied
    2
  3. 3

    Mark ticket as DONE

    There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
    import json from jira import JIRA creds = _get_creds(cred_label)['creds'] username = creds['username'] api_key = creds['password'] myjira = None if username and api_key and jira_server: myjira = JIRA( server=jira_server, basic_auth=(username, api_key) ) else: _problem = True msg = "Missing username or API key" print(msg) if myjira: try: next_states = myjira.transitions(issue_id) xns = [xn['name'] for xn in next_states] if 'Mark as done' in xns: op = myjira.transition_issue(issue_id, 'Mark as done') elif 'Resolved' in xns: op = myjira.transition_issue(issue_id, 'Resolved') else: msg = f"ERROR! Unable to transation to DONE for ticket: {issue_id}\n" msg += "Possible transitions: " + json.dumps(xns) print(msg) except Exception as e: msg = str(e) print(msg)
    copied
    3
  4. 4

    Assign a ticket to a user

    There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
    from jira import JIRA creds = _get_creds(cred_label)['creds'] username = creds['username'] api_key = creds['password'] myjira = None if username and api_key and jira_server: myjira = JIRA( server=jira_server, basic_auth=(username, api_key) ) else: _problem = True msg = "Missing username or API key" print(msg) if myjira: myjira.assign_issue(issue_id, assignee)
    copied
    4
  5. 5

    Plot resolved tickets per user

    There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
    import json from jira import JIRA creds = _get_creds(cred_label)['creds'] username = creds['username'] api_key = creds['password'] myjira = None if username and api_key and jira_server: myjira = JIRA( server=jira_server, basic_auth=(username, api_key) ) else: _problem = True msg = "Missing username or API key" print(msg) resolved_issues = {} if myjira: for user in users: issues = myjira.search_issues(f'project={project} AND assignee="{user}" AND status=done') resolved_issues[user] = len(issues) print(resolved_issues) context.plot.xlabel = "users" context.plot.ylabel = "# resolved issues" context.plot.title = "Resoved issues per user" context.plot.add_trace(name="Resoved issues per user", xpts=labels, ypts=values, tracetype="bar")
    copied
    5
  6. 6

    List tickets resolved by a user

    There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
    import json from jira import JIRA creds = _get_creds(cred_label)['creds'] username = creds['username'] api_key = creds['password'] myjira = None if username and api_key and jira_server: myjira = JIRA( server=jira_server, basic_auth=(username, api_key) ) else: _problem = True msg = "Missing username or API key" print(msg) resolved_issues = [] if myjira: issues = myjira.search_issues(f'project={project} AND assignee="{user}" AND status=done') for issue in issues: resolved_issues.append({'id': issue.key, 'summary': issue.fields.summary}) print(resolved_issues)
    copied
    6
  7. 7

    REOPEN a ticket

    There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
    import json from jira import JIRA creds = _get_creds(cred_label)['creds'] username = creds['username'] api_key = creds['password'] myjira = None if username and api_key and jira_server: myjira = JIRA( server=jira_server, basic_auth=(username, api_key) ) else: _problem = True msg = "Missing username or API key" print(msg) if myjira: try: next_states = myjira.transitions(issue_id) xns = [xn['name'] for xn in next_states] if 'Reopen issue' in xns: op = myjira.transition_issue(issue_id, 'Reopen issue') else: msg = f"ERROR! Unable to transation to DONE for ticket: {issue_id}\n" msg += "Possible transitions: " + json.dumps(xns) print(msg) except Exception as e: msg = str(e) print(msg)
    copied
    7
  8. 8

    Add a comment to a ticket

    There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
    from jira import JIRA creds = _get_creds(cred_label)['creds'] username = creds['username'] api_key = creds['password'] myjira = None if username and api_key and jira_server: myjira = JIRA( server=jira_server, basic_auth=(username, api_key) ) else: _problem = True msg = "Missing username or API key" print(msg) if myjira: myjira.add_comment(issue_id, comment)
    copied
    8
  9. 9

    Create a JIRA ticket

    There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
    from jira import JIRA creds = _get_creds(cred_label)['creds'] username = creds['username'] api_key = creds['password'] myjira = None issue_id = "" if username and api_key and jira_server: myjira = JIRA( server=jira_server, basic_auth=(username, api_key) ) else: _problem = True msg = "Missing username or API key" print(msg) if myjira: issue_dict = { "project" : project, "summary" : summary, "description" : description, "issuetype" : {"name" : "Task"} } new_issue = myjira.create_issue(fields=issue_dict) issue_id = new_issue.key print(issue_id)
    copied
    9