What a time the cPrime crew had at the Atlassian Summit! We were thrilled to receive Atlassian Partner of the Year 2018: Agile for our contribution and achievements during Atlassian's fiscal year 2018 and happy to be recognized for our expertise in the Agile space.
We were also happy to be able to meet and talk to so many of our current and future customers, who came to see what awesome automation features Power Scripts could provide them to make their Jira life easier. We had some great conversations and gathered lots of feedback leaving us anxious to get back to work to build out these new suggestions (well, as anxious as you can be to leave relaxing, sunny Barcelona :P)
Curiously, we also discovered that many of the questions people had when approaching our booth, could be solved with the same basic script.
The 5 minute challenge
We asked users to come to us with a problem they had to see if our experts could solve the problem using Power Scripts in 5 minutes or less.
As more and more customers tried unsuccessfully to stump our experts, we excitedly discovered that the majority of the solutions actually started out from the very same script base. We realized that this base was an important building block for many different types of scripts. We are calling this script the loop base. Below is more detail around how to use this in your Jira scripting:
Loop Base Script
1 |
|
Sections
The loop base is made of 3 sections, the List section, the Loop section, and the Action section. In its most basic form, the script is only 4 lines of code.
Loop Base Script
1 |
|
The List section is the part of the code where a list of objects is gathered. This list could be any other issues in Jira, a list of sub-tasks, links, rows in a database, etc. In almost every case this section only needs to be one line of code.
Select issues using JQL
|
Get an issues sub-tasks
|
Get the issues links
|
Get the attachments for an issue
|
Get data from a database
|
The Loop Section is the part of the code where we go through the list of objects one by one. The syntax for this loop is almost always the same. This section is essentially one line of code with a closing bracket at the end.
Select issues using JQL
|
This section is where actions are performed on the objects gathered in the list section. This could be writing a message to the screen, closing a subtask, or writing data to a database. This section could have as little as one line of code or many more lines depending on the action being performed.
Close subtasks
|
Copy data to a different customfield
|
Escalate priority
|
Send an email
|
Change priority of issues that are past due
1 |
|
Close sub-tasks when main issue is closed
1 |
|
Copy data to a different customfield
1 |
|
Copy data from the parent
1 |
|
We hope you enjoy these Loop Base script examples and a few pictures from our time at Summit!
Michele Lim [Cprime]
Product Marketing Manager
Cprime
San Francisco
1 accepted answer
6 comments