Can you use AI in your job?

Welcome to thejiraguy.com, the ultimate destination for all things giraffe-related! Here, we celebrate the beauty and majesty of one of the most beloved animals in the world. Our mission is to educate, inspire, and entertain anyone interested in giraffes, from the casual admirer to the dedicated enthusiast. So whether you’re looking to learn more about these gentle giants, discover fascinating facts and trivia, or enjoy stunning photos and videos of giraffes in their natural habitat, you’ve come to the right place. So join us on a journey of discovery and appreciation as we explore the world of giraffes and all that makes them unique.

This, Jira Guys and Gals is what I got with the prompt “Write me an intro paragraph in the style of posts from thejiraguy.com.” And we get…Giraffes. I don’t think ChatGPT knows what thejiraguy.com is, which, honestly, I’m not sure if that makes me happy or sad.    

I’m sure you’ve seen at least a dozen pieces asking, “is ChatGPT/LLM/AI coming for your jobs?” That’s not this post. For one, I am not qualified enough to speak on the economics of the situation. Any conclusion I draw would be flawed as I fail to grasp some fundamental part of the equation. 

You’ve probably seen your favorite creators using the tools to create whole content pieces, including voice and visuals. Fortunately, that is also not this post. Don’t get me wrong, I’ve debated it, but as we’ve seen above, all I’m likely to get is a puff piece about Giraffes. Possibly interesting, but not exactly why you are here.  

No, I want to go one step further. This isn’t a piece on how AI is going to replace you. Now, it’s a piece about how you can partner with these new tools to make you better at your job. Don’t get me wrong, it’s an interesting time to be alive, but those who survive will be those who can adapt to using these tools to augment their work. So, let’s see how you can use these tools to make your life much easier!

Documentation? Who Writes Documentation!?

This might be a little on the nose, as this website could be viewed as a giant documentation project. I’ve been known to copy & paste stuff from here into Confluence when writing my own end-user documentation. Why not? I (presumably) have the copyright holder’s permission, and there is no need to write the same thing a second time, right?

But even that depends on someone (me) to have written it at some point, and I have yet to begin to cover every topic about Jira, let alone Confluence, Bitbucket, Crowd, and Trello…seriously, I can be here for a bit.

So why not have ChatGPT write it for you? In this case, I asked ChatGPT, “How do I search for issues in Jira?” and after a bit, it responded with this text:

Don’t get me wrong; minor details are wrong here and there. For example, Step 2 mentions a “Search” button, but no such button exists on either Jira Cloud or Jira DC. But on the whole, it’s close. It even has a call out for using JQL and the quick search bar – the former of which you can link to another page with how to use JQL. As a follow-up, I asked Chat GPT, “How do I write a JQL Search string for Jira?” But, again, minus the stumble in Step 2, it’s right on the point.  

Neo: “I know Groovy.”

So, I’m not great at Groovy. I can get by, but definitely not writing many of my own scripts for Scriptrunner.

But, who says I have to? I gave ChatGPT a simple enough prompt: “Write a groovy script for Scriptrunner that grabs all issues where the environment field is populated and copies that field value into another field.”

It took 30 seconds to come up with this, which looks correct on the whole. I’m still running it first in a well-backed-up non-prod, but it should work.  

import com.atlassian.jira.component.ComponentAccessor

def customFieldManager = ComponentAccessor.getCustomFieldManager()

// Get the Environment custom field
def environmentField = customFieldManager.getCustomFieldObjectsByName("Environment").first()

// Get the New Field custom field
def newField = customFieldManager.getCustomFieldObjectsByName("New Field").first()

// Get all issues where the Environment field is not empty
def issueManager = ComponentAccessor.getIssueManager()
def searchProvider = ComponentAccessor.getComponent(com.atlassian.jira.issue.search.SearchProvider.class)
def query = "Environment is not EMPTY"
def searchResult = searchProvider.search(query, ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser(), com.atlassian.jira.web.bean.PagerFilter.getUnlimitedFilter())

// Loop through the issues and copy the Environment field value to the New Field
searchResult.getIssues().each { issue ->
    def environmentValue = issue.getCustomFieldValue(environmentField)
    issue.setCustomFieldValue(newField, environmentValue)
    ComponentAccessor.getIssueManager().updateIssue(ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser(), issue, com.atlassian.jira.event.type.EventDispatchOption.DO_NOT_DISPATCH, false)
}

This isn’t limited to Groovy, though. My friend, Jesse Wisener, generated this prompt to migrate issues between Jira instances in python. 

import requests
import json

# Set the Jira API endpoints for the source and target instances
source_url = "https://source-jira-instance.com/rest/api/2"
target_url = "https://target-jira-instance.com/rest/api/2"

# Set the Jira project key for the project you want to migrate
project_key = "PROJECT_KEY"

# Set the authentication credentials for the source and target instances
source_auth = ("source-username", "source-password")
target_auth = ("target-username", "target-password")

# Get all issues in the source project
source_issues_url = f"{source_url}/search?jql=project={project_key}&maxResults=1000"
while source_issues_url:
    source_issues_response = requests.get(source_issues_url, auth=source_auth)
    source_issues = json.loads(source_issues_response.text)["issues"]

    # Loop through the issues and migrate them to the target instance
    for issue in source_issues:
        # Get the issue key and URL
        issue_key = issue["key"]
        issue_url = f"{source_url}/issue/{issue_key}"

        # Get the issue details from the source instance
        issue_details_url = f"{source_url}/issue/{issue_key}"
        issue_details_response = requests.get(issue_details_url, auth=source_auth)
        issue_details = json.loads(issue_details_response.text)

        # Create the issue in the target instance
        create_issue_url = f"{target_url}/issue"
        create_issue_payload = json.dumps(issue_details)
        create_issue_response = requests.post(create_issue_url, auth=target_auth, data=create_issue_payload, headers={"Content-Type": "application/json"})

        # Print the result
        if create_issue_response.status_code == 201:
            print(f"Successfully migrated issue {issue_key} from {issue_url} to {create_issue_response.json()['self']}")
        else:
            print(f"Failed to migrate issue {issue_key} from {issue_url} to {target_url}. Reason: {create_issue_response.reason}")

    # Get the URL for the next batch of issues, if it exists
    source_issues_url = json.loads(source_issues_response.text)["next"]

So, congratulations. You no longer have to be a programmer to get basic things done. Is Scriptrunner exploring this to remove a roadblock from their (already popular) App?

Emails? Naw, you do it!

I hate writing emails, especially when I have to give people bad news like, “I won’t do this because what you are asking is fundamentally flawed and, in general, is a bad idea.” I’ll spend an hour figuring out how to put that more tactfully. So what happens when I ask ChatGPT to write it for me? Well, it’s a rather well-thought-out form letter that puts it much better than I could.  

Dear [Requester],

I hope this email finds you well. I appreciate your request for me to perform [the task requested]. However, after careful consideration and analysis, I have come to the conclusion that performing this task may actually cause issues with Jira in the long run.

I understand that [reasons for request]. However, given the current state of Jira, performing this task would [describe potential negative impact].

Therefore, I regret to inform you that I will not be able to fulfill your request. I understand that this may not be the response you were hoping for, but my priority is to ensure the stability and functionality of Jira for all users in the long term.

Thank you for your understanding and cooperation in this matter. Please let me know if you have any further questions or concerns.

Best regards,

[Your Name]

I’m not joking; if left to my own devices, nothing I come up with would likely be that well done. I tend to be a bit blunt when dealing with end-users, so having a tool that helps me be gentler will be a great thing. 

TL;DR: What does this all boil down to?

It’s easy to say the sky is falling. But honestly, it will only fall on those who refuse to adapt to changes. We’ve all been willing to learn new skills to accomplish more – which is usually how we find ourselves becoming Jira Admins in the first place. This is just another adjustment. Will it change everything about how we do things? Possibly, but likely not. Can we slot it here and there to make the boring jobs less time-consuming? Absolutely!  

So now, the sky is not falling. We need to keep on learning!

What do you think?

Are you scared about the impending AI revolution? Have you tried using these new tools in your work? I want to hear from you! Please leave a comment with your thoughts, concerns, and questions!

A Note here before we sign off entirely. I am happy to announce that Old Street Solutions will sponsor this year’s Team 23 coverage! What does this mean? For one thing, we will have coverage from all the Keynotes, as I’m sure you have come to expect. But furthermore, you will actually meet me at the Old Stree Solutions Booth! We are still hammering out the details, but I most look forward to meeting many readers for the first time!

Also, Old Street’s own Fun Man Andy is starting his America’s Tour on his way to Team 23 soon, and if you manage to get to an event he’s speaking at, you can get new thejiraguy.com SWAG. Keep an eye on my Twitter account, I’ll be retweeting events as they are announced!

Of course, you can find my Twitter and other Social Media links on Linktree. Be sure to like, comment, and share my posts to tell the algorithms to show it to more people! 

But until next time, my name is Rodney, asking, “Has ChatGPT Updated your Jira issues for you today?”

1 Comment

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.