Introduction
This article should help those who are somehow connected with setting up the processing of applications in JIRA and want much more than is offered in the standard package, but is not a Java developer and does not have such people at hand.
I think everyone should be aware that JIRA is an open system for the external development of additional plug-ins (this is by the way very good). Those. knowing how to develop on java + maven + eclipse, knowing well web design, etc., etc., you can attach everything you want to JIRA: make plugins, install and use. Moreover, you can sell these plugins and even live on it.
But there are such people, the majority of which do not know "anything". And therefore they use the built-in features or the plug-ins that exist. But plug-ins are not for every occasion, and many of them are paid, although just the most necessary.
')
There is a solution!
So, there is one plugin, although it is paid, but it knows a lot
(and everyone would like to), which will allow us to intervene in the processing of applications and a lot of things to do what we want, as well as help automate some of the settings and actions that either users or no one in general does in life.
This is a
JJupin plugin.
It is notable for the fact that it has a built-in scripting language SIL (Simple Issue Language), which is a wrapper over the internal functions of the JIRA API
Scripts written in this language (we will call them sil-scripts) are stored in files (* .sil) and can be used:
- As post-functions of process transitions (Post functions);
- As conditions in the same place (Conditions);
- As validators (Validators);
- Listeners of events (Listeners);
- Services (Services);
- Control fields and their values on the transition screens;
- Give values for calculated fields (this is a separate free plugin).
Maybe I missed something, but this list is already enough to make our life easier by setting up processes.
It is also necessary to be able to somehow customize business processes, but I think this is not a problem, everything is in order with the JIRA documentation.
How to cook it
Sil-script is a fairly simple language that any person can master, not entirely alien to logic and algorithms. Easier even than basic.
In the documentation for the plugin all operators, types and functions are listed, there are examples of use.
To work with a JIRA application, there is a list of predefined variables, such as the name, application text, owner, performer, status, etc.
Also from the script there is access to custom fields - a construction like customfield_11111, where 11111 is the field ID.
The field ID can be viewed in the list of custom fields by clicking on the gear on the right and opening the list of actions above the field - a link to any action will contain customFieldId = 10111, this is what we need. The field value will be its visible text value. Those. if your field is a directory, then the value of the user field will be the name of the selected directory item, and not its ID.
Now an example. Suppose, when creating an application, we need to set a specific executor and add an “Automatically assigned” text to the application text when creating the application category field (field ID 10122).
- Go to the business process, open it for editing;
- In BP, select the transition "Create" (Create an application, this should be done from the diagram);
- Moving to the “post functions” transition;
- Add a new post function, select "(k) SIL Post-function" in the list of post functions, click add
- Further, in the next step, we open the data on the post function:
- Specify the file name (just a name, without the .sil extension), or select an existing script, but we do not have it yet
- We write a script
- Above the script input field there is a blue button “CHECK”, which checks the script for syntax errors. We press it to check whether everything is so
- Click "Add". File created, script added.
- Next in the list of postfunctions we move the script by clicking on the arrows to the place below paragraph 1
- We publish the business process and see the result
Here is the script that we need (at the same time I will show the use of variables):
string s;
In the same way, conditions and validators can be added to the transition.
Validator example:
if (currentUser() == "petyaivanov" and customfield_10122 == " ") { return false, "customfield_10122", ", ";
A very up-to-date validator for commenting on the transition:
string errorMsg = " "; if(not hasInput("comment")) { return false, "comment", errorMsg; }
Attention! Sil-script case-sensitive language, make sure the correct spelling of variables and functions!
What else can JJUPIN
In addition to the standard and simple actions on the values of orders, the plugin also knows the following:
- Work with arrays (many values of fields and functions are represented as arrays);
- Execute jql queries (these are the same search filters in the JIRA interface);
- Execute sql queries (this is generally very interesting and very useful);
- Work with users, roles and groups;
- Send email;
- Call the events that you have registered in the notification scheme;
- Work with fields on the viewing, editing and other screens on transitions, changing field values depending on others, hiding fields, etc. (the functionality is slightly reduced, but still great);
- And a lot of other things.
findings
I think, further it is clear how it is very simple and very useful to use sil-scripts to make life easier for yourself and all JIRA users.
And if you or your colleague can write sql queries, then your capabilities increase greatly, very much!
But more about that another time, otherwise the article will be very heavy.
I plan (and there as it will) to write a few more articles on the specific use of sil-scripts to improve functionality, as well as in conjunction with the JIRA Service Desk plugin (and the SD plugin itself, and the combination of these two gives us good goodies). In almost all examples, we will use sql-scripts and a little less often - our own tables in the database (we will store configuration information in them, which will give us the opportunity to manage the results of their work without changing scripts).
Threat All that is described here is based on two years of experience using Atlassian JIRA for a variety of automation in the company. Experience from scratch, without finishing any courses, etc. Therefore, if someone offers better solutions, I will be glad. I wrote the article just because I want to help other people a bit to make life easier by setting up JIRA.