HAPI Revolution – ScriptRunner for Jira update

Written By Michael  |  Jira, ScriptRunner  |  0 Comments

  • Home
  • Blog
  • HAPI Revolution – ScriptRunner for Jira update

Hey, it’s Michael,
First, a big thank you to Adaptavist, our sponsor for this week’s newsletter
Let’s talk today about HAPI Revolution. #Ad

If you are on Jira Data Center or Server and are thinking of automating some of your tasks, let me show you something which will knock your socks off. So today, let’s talk about the latest update for ScriptRunner – HAPI.

What is HAPI?

HAPI, the latest update for the ScriptRunner for Jira, is a simplified, more human way to define your automation and customizations in Groovy (the scripting language most commonly found in ScriptRunner products) without yielding any bespoke capabilities you love the tool for.

As a Jira admin, the biggest struggle was always coding in Groovy. ScriptRunner for Jira is always a must-have, but a steep learning curve on how to write a simple script blocked me for years. This was mainly due to the lack of real-life examples and complicated Groovy / Java syntax language. I know this is a big issue for new admins as well. 

But… that will change forever, I can promise you. In this short video (video link included), I will show you how to create and update any Jira task in minutes. You will learn how to create a Jira task using three lines. Plus, from now you can use the ScriptRunner Console, which was redesigned with auto-completion and copy-paste examples.

Oh, and that’s not it! You don’t have to update your scripts to HAPI, as it’s 100% compatible with your existing scripts. You can also use what I call “hybrid mode.” A bit of HAPI and classic JAVA / Groovy code. How much does it cost? If you’re already ScruptRunner clients, it’s FREE. How cool is it? 

What about the ScriptRunner library? It will also be updated soon, so more HAPI scripts are coming. 

I will only give a few examples; you can watch the rest on my YT channel

So let’s do something straightforward. I need a Jira Task for my project DS (Demo Scrum). I don’t want to compare it to the old coding, so let’s do it in HAPI. You can test it from your ScriptRunner Console. Just make sure to update ScriptRunner on your Jira Instance.

Issues.create('DS', 'Task') {
    setSummary('My Issue Summary')
    setDescription('Some description')
}

As I told you, it’s only three lines of code! 
Ok, now something more interesting

Issues.create('DS', 'Story') {
    setSummary('My Issue Summary from SR Console')
    setPriority('High')
    setDescription('Some Demo Description')
    setAssignee('admin005')
    setLabels('Demo')
    setDueDate('08/March/23')
    setCustomFieldValue('Mac or PC','MAc')
    }

I just created a ticket with Labels, priority, and Due Date even though I set a value to my Custom Field;
also, you don’t need to check what is a custom Field ID anymore (mind-blowing).

So now, let’s create a new project; why not? 

Projects.create("DPS", "Demo Project Scrum") {
    projectLead = 'admin'
    projectType = "Scrum"
    description = "This is a new project!"
    url = "https://ProjectFlow.co.uk"
    setDefaultAssigneeToProjectLead()
    avatarId = 10001}

It’s only a few examples, but I hope you now understand what a robust improvement to ScriptRunner HAPI is. I also have a few links for you, so don’t just sit on them. Go away now and start coding in HAPI 🙂 

Watch Now ➡️: https://youtu.be/PcPtG5tCdFM 

Try HAPI now: https://bit.ly/scriptrunnerhapiw

My GitHub Scripts (Free Download): http://bit.ly/3mDylJg

Thanks, Michael. 


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>