
jira programming language
Jira does not have a proprietary programming language. Instead, it offers various scripting and automation options to extend its functionality. Here’s an overview of the primary scripting languages and tools used in Jira: jira programming language
Jira Expressions: What Is It and Why Does It Matter?
- When does the C-suite of a multinational, multibillion-dollar company start to care about a relatively unknown coding language?
- You only need to move your current custom-scripted Jira on Server or Data Center processes to Jira Cloud.
- The most popular programs for handling these types of custom scripts for users in Jira Server or Data Center setups are:
- Script runner
- Jira Miscellaneous Workflow Extensions
- PowerScripts
The issue is that users’ scripted workflows malfunction when they switch to Atlassian Cloud from these well-known scripting systems.
Why?
- Because Atlassian Cloud uses a different scripting format, Jira Expressions must be used on the Cloud. Jira Expressions:
- What is it? Using conditions and validators, Jira Expressions is a domain-specific language created for Jira Cloud that enables developers and Jira administrators to customize workflow transitions.
- To put it another way, Jira Expressions is used to create any custom automation that a Jira Cloud user wants to enhance and expedite the workflow, approvals, and data flow. jira programming language
- Jira Expressions’ primary purpose is swiftly reading Jira data so administrators can modify validators and conditions. For instance, suppose that before a Jira issue can be marked as “In Progress” or “Done” in its workflow, a member of the HR team must approve it. Jira Expressions must contain the code instructing Jira Cloud to verify this when the issue is migrated.
Why is it important?
It sounds simple, and it is.
However, we have seen that most cloud-migrating firms do not understand the need to address this at an early stage of the migration process.
We were also caught off guard early on by the depth and complexity this adds to the migration. After hundreds of successful migrations, however, we can now recognize the issue for what it is.
Here are some reasons why you should think about using Jira Expressions well in advance of your migration:
- It is a complex language. Although Jira Expressions is built on JavaScript, it is not entirely JavaScript or any other widely popular language.
- It is not easy to convert your existing scripts into Jira Expressions. It will require time for your IT staff to become proficient in its utilization. I
- t is also not simple.jira programming language
- You likely have more custom workflows than you think. For large enterprises that have been using Jira Server or Data Center for a long time, hundreds or even thousands of unique workflow transition scripts may be running in the present instance.
- Not many are even recorded. It will, therefore, take a lot of work to go through and update them all. jira programming language
- There is hardly any documentation about Atlassian, and there is not much documentation available for a scripting language that is so hard and opaque. Furthermore, no comprehensive training programs are being offered.
What occurs if Jira Expressions are not taken into account?
Regretfully, this has occurred several times. Making minor adjustments to bespoke workflows seems insignificant while focusing on a variety of other migration-related issues.
However, it isn’t.
- If you do not include Jira Expressions in your preparations before the migration, the following can happen:
- The relocation may become more expensive.You want to plan and carry out the migration process as effectively as possible, whether you are doing it alone or with a partner. Dealing with Jira Expressions after the fact will take more time and money. jira programming language
- It might not be suitable for your company.The smooth operation of Jira is essential to your team’s productivity after the migration. Restoring your basic Jira functionality to its pre-migration state could take a while if some or all of it stops working due to malfunctioning scripts.
- Cprime is a certified Cloud specialist and an Atlassian Platinum Solutions Partner. After hundreds of Atlassian migrations, we have figured out what works and what doesn’t, and we have created a tried-and-true architecture for a smooth transition from Server or Data Center to Atlassian Cloud.
- This means evaluating, refining, and switching to Jira Expressions from your current custom process scripting language.Speak with an expert right now to ensure a seamless relocation.
1. Jira Expressions (Cloud Only)
Jira Expressions is a domain-specific language designed for Jira Cloud. It’s JavaScript-based but has its own syntax and limitations. You can use it to create conditions and validators in workflows. For example, to ensure that an issue has at least one PDF attachment before transitioning, you can use: Documentation+5Medium+5
Jira Expressions is primarily used for evaluating conditions and validators in Jira Cloud workflows. It’s not suitable for complex scripting tasks. Atlassian Developer+7Cprime+7Adaptavist Documentation+7
🛠️ 2. ScriptRunner for Jira (Cloud & Server)
ScriptRunner is a popular plugin that extends Jira’s capabilities. It supports multiple scripting languages:YouTube+2Atlassian Community+2Adaptavist Documentation+2
-
Groovy: Used for post functions, scripted fields, and listeners. It’s a powerful scripting language that allows for complex logic and integration with Jira’s REST API. Adaptavist Documentation+1Atlassian Community+1
-
JavaScript/TypeScript: Utilized for Behaviours and Script Fragments. Behaviours allow you to dynamically change field values and visibility on the UI, while Script Fragments enable you to add custom UI elements. Adaptavist Documentation
-
Jira Expressions: Used for conditions and validators in workflows. It’s a lightweight language suitable for simple logic. Atlassian Developer+8Adaptavist Documentation+8Cprime+8
ScriptRunner enhances Jira’s automation capabilities, enabling custom scripts to automate tasks and integrate with other systems.Adaptavist Documentation+1YouTube+1
🔍 3. Jira Query Language (JQL)
JQL is Jira’s query language used to search for issues. While not a scripting language, it’s essential for filtering and retrieving issues based on specific criteria. JQL can be used in conjunction with other scripting tools to perform actions on the retrieved issues.Adaptavist Documentation
🧩 4. Other Scripting Tools
-
SIL (Simple Issue Language): An alternative scripting language used in some Jira plugins. It’s designed to be simpler than Groovy but may not support all Jira features. jira programming language
-
REST API: Jira’s REST API allows for programmatic access to Jira data. You can use any programming language that supports HTTP requests to interact with the API.
🧑💻 Jira Automation
Jira offers built-in automation rules that can help you automate tasks without needing extensive programming knowledge. These automations can be used in both Jira Cloud and Jira Server/Data Center. Here’s how it works:
Automation Rules
Automation rules in Jira enable you to automate tasks like:
-
Transitioning issues automatically.
-
Sending notifications when certain conditions are met.
-
Adding or removing labels or components.
-
Creating new issues based on specific triggers.
These rules are configured using the following basic structure:
-
Trigger: What starts the automation (e.g., issue created, status changed).
-
Condition: The criteria the issue must meet for the rule to proceed (e.g., issue type = “Bug”).
-
Action: The task that will be executed (e.g., assign issue to a specific user, add a comment).
Examples of Automation in Jira:
-
Auto-Assign: When a bug issue is created, automatically assign it to a specific person.
-
Change Issue Status: If an issue is not updated in a certain time frame, automatically change its status to “Stale.”
-
Notify Team Members: If an issue moves to “In Progress,” notify the assigned user’s team via email or Slack.
🔧 ScriptRunner Advanced Customization
ScriptRunner is an extremely powerful Jira plugin that allows you to perform much more complex automation and scripting. Here are the main capabilities of ScriptRunner:
1. Scripted Fields (Groovy)
Scripted fields allow you to calculate and display custom data in your Jira issues. You can use Groovy scripts to manipulate the issue data and display calculated fields. For example:
-
Display the number of open subtasks for an issue.
-
Calculate the time spent on a task based on custom workflows.
2. Custom Listeners (Groovy)
Listeners allow you to react to Jira events such as:
-
Issue created.
-
Issue updated.
-
Transitioned issue.
You can write a Groovy script to listen for specific events and perform actions like sending emails, creating issues, or updating fields based on those events.
3. Behaviours (Groovy/JavaScript)
Behaviours allow you to manipulate the behavior of fields on issue screens, making the UI dynamic. With behaviours, you can:
-
Make fields read-only or required based on conditions.
-
Set default values for certain fields dynamically based on other field values.
4. Scripted Post Functions (Groovy)
ScriptRunner allows you to run custom scripts as part of the workflow transitions. For example:
-
Automatically update a field when an issue transitions to a certain status.
-
Create sub-tasks or related issues when an issue reaches a certain state.
This feature is especially powerful for automating repetitive tasks and adding business logic to workflows.
🖥️ Using the Jira REST API
Jira provides a REST API that allows external applications or scripts to interact with Jira data. This is particularly useful for integrations with other tools or creating complex automations. You can interact with Jira’s database programmatically using standard HTTP requests.
What can you do with the Jira REST API?
-
Get issue data: Retrieve details about issues, comments, users, etc.
-
Create or update issues: Programmatically create new issues or update existing ones.
-
Manage workflows: You can trigger transitions, add comments, and update issue statuses.
You can use the REST API with any programming language that supports HTTP requests, such as Python, JavaScript, Java, and others. Some common uses include:
-
Syncing Jira with other project management tools.
-
Creating automated reports based on issue status or workload.
-
Integrating Jira with third-party systems (e.g., CRM, testing tools).
Example of a REST API call in Python:
# Jira URL and API endpoint
url = “https://your-domain.atlassian.net/rest/api/3/issue/TEST-123”
# Authentication credentials (email & API token)
auth = HTTPBasicAuth(“your-email@example.com”, “your-api-token”)
# Make the GET request to retrieve issue details
response = requests.get(url, auth=auth)
# Parse the JSON response
issue_data = response.json()
# Print the issue summary
print(f”Issue Summary: {issue_data[‘fields’][‘summary’]}”)
💻 Jira Query Language (JQL)
JQL is one of the most important tools for navigating Jira data. While it’s not a programming language, it’s an essential tool for advanced searching and reporting.
JQL Basics:
-
Simple Queries: You can filter issues based on basic fields like project, issue type, priority, etc.
-
Example:
project = "MyProject" AND status = "In Progress"
-
-
Complex Queries: Use logical operators (AND, OR, NOT) and functions (e.g.,
currentUser()
,startOfDay()
) to create advanced queries.-
Example:
assignee = currentUser() AND created >= startOfWeek()
-
Use Cases for JQL:
-
Create Custom Dashboards: Build dashboards to track team progress, issue statuses, or bug trends.
-
Advanced Filtering: Filter issues by specific conditions such as date ranges, custom fields, etc.
-
Automation: Use JQL in automation rules to trigger specific actions based on issue queries.
🌐 Jira Cloud vs Jira Server
It’s important to note that there are some differences in scripting and customization capabilities between Jira Cloud and Jira Server/Data Center:
-
Jira Cloud:
-
Has limitations on what custom scripts can do, especially compared to Server.
-
You can use Jira Expressions (Cloud-specific) and some automation rules, but complex scripting requires plugins like ScriptRunner or third-party apps.
-
Focuses on simplicity and ease of use, which makes it great for small to medium-sized teams or simpler workflows.
-
-
Jira Server/Data Center:
-
Offers more extensive scripting capabilities with Groovy (via ScriptRunner) and custom listeners, behaviours, and post-functions.
-
It also allows the use of the Jira REST API with greater flexibility, including custom integrations with third-party tools.
-
Learning Resources for Jira Scripting:
-
Atlassian Documentation: The official documentation is an excellent starting point. It includes guides on automation, JQL, REST API, and ScriptRunner.
-
Online Courses: Platforms like JNNC Technologies offer comprehensive courses on Jira and its advanced scripting functionalities, including automation, ScriptRunner, and JQL.
-
Community and Forums: Atlassian has a vibrant community where users share scripts, tips, and solutions. This is a great place to learn from others and solve any issues you might encounter.
Conclusion
Jira scripting and automation capabilities can dramatically enhance your workflows, making repetitive tasks easier and adding custom functionality. Whether you’re using built-in automation, Jira Expressions, or advanced scripting with ScriptRunner, you can tailor Jira to meet your team’s needs. For more complex customizations, leveraging the REST API or learning Groovy and JQL will provide even more flexibility.
If you have specific use cases or want guidance on starting with any of these tools, feel free to ask!