Exploring Advanced Scripting: Navigating Through Unique Integration and Migration Scenarios with Getint

New Release|News

April 26, 2024

Table of Content

Each integration and migration case is unique.

But uniqueness doesn’t have to mean significant complications from the very start.

In getint, we believe in doing easy things in an easy way, whenever possible.

That means setting up integrations, and migrations using the easy-to-use, intuitive interface as long as it is possible, and adding scripts to handle advanced, more complicated scenarios on top of the UI.

This differentiates us from Exalate, another Atlassian Marketplace Vendor, who requires you to choose – use a UI, or scripting.

Why not use the power of both, combined?

In this blog post, we will describe some of the most common use cases, when the scripts are useful.

Let’s start with the screens, here is how our UI looks. It enables you to do one-to-one mapping of types, and fields. If the field has a type dropdown f.e. you can easily do the additional mapping of given values between the systems you integrate.

And here is the view of the tab, that lets you add scripts on top of the setup done in the UI.

As part of our custom development policy at getint, we also offer the possibility to write scripts for you, tailored to your specific needs.

Use case 1: Migrating from Azure DevOps to Jira Cloud (migrating values from several fields, directly to the description field)

One of our customers, well known German car manufacturer (read the case study here) was migrating from Azure DevOps to Jira Cloud. Apart from the migration license, they requested consulting, and that the execution of the migration be done by our team. While setting up the scope, we learned that there are way more fields on Azure DevOps, than fields in the newly created Jira.

Creating the fields in Jira just for the sake of the migration, to keep the data from DevOps was missing the point – since the migration is a great opportunity to simplify things. It was the first use case, where we decided to do the custom development and add the scripting option, that you can now use.

We provided scripts, that where injecting the values from several fields from Azure DevOps directly to the “Description” field in Jira. That resulted in customer stakeholders being happy, that the data are migrated, and the project teams who could keep Jira clean.

Use case 2: Integrating GitLab with Jira Cloud (adding information from GitLab code repositories to Jira issues)

Another of our clients was integrating GitLab with Jira and needed to add given information from the code repository such as pull requests and commits to related Jira issues. Previously, this action was performed manually by one of the developers. In a large-scale integration, doing it manually was not possible. Again, the scripts were the solution, that works as intended.

Use case 3: Migrating from Freshdesk to Jira (merging values from many Fresh fields to a few in Jira)  

While migrating from Freshdesk to Jira, our customer wanted to merge plenty of fields on the Fresh side to a smaller number of fields in Jira. Additionally, in Jira, we had dropdown fields that had different values – so simple mapping was not possible. We ended up receiving a CSV file, and we used it to write a script that was assigning values in Jira based on the values in Freshdesk.

Use case 4: Integrating ServiceNow with Jira (multi-level status transitions)

Imagine a case, where you have different workflows in both systems you integrate. In Jira, you have “to do”, “in progress”, “in review”, and “done”.

To move the task from “in progress” to “done”, the task must first go to the “in review” stage.  Meanwhile, in ServiceNow you only have “to do”, “in progress”, and “done”.

So when the user is making a transition in ServiceNow from “in progress” to “done”, there is no way to do the right transition in Jira since the status “in review” is not involved. Unless you can write the script to perform the transition. That’s exactly what we did.

Java Script for getint integrations

Advanced mode (scripting) provides a way to customize app logic when it comes to building data that is going to be sent out to apps via API. Read more here.

The script should be compliant with JS syntax. It is a JavaScript code that is run by GetInt when specific events will be triggered.

What is JS Syntax?

JS (JavaScript) syntax refers to the rules and structure that govern the writing of code in the JavaScript programming language. It defines the way in which code is written and executed in a JavaScript program.

Here are some key components of JavaScript syntax:

Statements: JavaScript code is composed of a series of statements that perform specific actions. Statements can be separated by semicolons (;) or line breaks.

Variables: In JavaScript, variables are used to store data values. To declare a variable, use the keyword “var”, followed by the variable name and its initial value (if any).

Data Types: JavaScript has several data types, including numbers, strings, booleans, arrays, and objects. These data types determine the kind of data that can be stored in a variable.

Operators: Operators are used to performing actions on values and variables. JavaScript includes arithmetic operators (such as + and -), comparison operators (such as == and !=), and logical operators (such as && and ||).

Functions: Functions are blocks of code that can be called and executed repeatedly. In JavaScript, functions are declared using the keyword “function”, followed by the function name and its parameters.

Overall, JavaScript syntax provides a way for developers to write code that is structured, consistent, and easy to read and understand.

Events for which you can define script and available functions/variables:

Before integration runs: It runs every time just before integration runs.

api.leftApp.fetch(url) – fetch data from endpoint from LEFT side app
api.leftApp.post(url, postData) – post data to LEFT side app
api.rightApp.fetch(url) – fetch data from endpoint from RIGHT side app
api.rightApp.post(url, postData) – post data to RIGHT side app
api.log(string) – write a log line to log file of the run

On before item request object sent: Is run before CREATE or UPDATE requests are sent with item data

api.leftApp.fetch(url) – fetch data from endpoint from LEFT side app

api.leftApp.post(url, postData) – post data to LEFT side app

api.rightApp.fetch(url) – fetch data from endpoint from RIGHT side app

api.rightApp.post(url, postData) – post data to RIGHT side app

api.log(string) – write a log line to log file of the run

state.syncAction – Create or Update

state.reqObj – request object data (containing fields) that was prepared by GetInt

state.triggerObj – data of the trigger/source object

e.g. if ITEM-1 was modified in Jira and will be synced with Azure Work Item #32, state.triggerObj contains data of ITEM-1 and state.reqObj is a constructed data object that will update #32

Before a comment is created

api.leftApp.fetch(url) – fetch data from endpoint from LEFT side app

api.leftApp.post(url, postData) – post data to LEFT side app

api.rightApp.fetch(url) – fetch data from endpoint from RIGHT side app

api.rightApp.post(url, postData) – post data to RIGHT side app

api.log(string) – write a log line to log file of the run

If state.comment – comment data that was prepared by GetInt to send

Summary

Whenever integrating collaboration software tools, or migrating from one tool to another you want to use a platform that offers you a wide variety of options. Additionally, you need a tool that can evolve as your use case. It can start small, with a simple process, and change to more advanced and complicated scenarios along the way.

Try getint integrations now.


BLOG

Our Latest News & Updates

Exeperience a smarter way to integrate & synchronize.

Discover the power of seamless connections, bridging your favorite tools for optimized workflow and productivity. Unleash the potential of unified platforms with Getint.

$(“a”).each(function() { var url = ($(this).attr(‘href’)) if(url.includes(‘nofollow’)){ $(this).attr( “rel”, “nofollow” ); }else{ $(this).attr(‘’) } $(this).attr( “href”,$(this).attr( “href”).replace(‘#nofollow’,’’)) $(this).attr( “href”,$(this).attr( “href”).replace(‘#dofollow’,’’)) });