Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

This guide provides comprehensive instructions for migrating Power Scripts from Jira Data Center (DC) to Jira Cloud. The migration process requires careful planning and execution to ensure the continued functionality of your scripts in the cloud environment.

Power Scripts migration involves moving scripts between fundamentally different environments. Key differences include:

  • Modified execution context

  • Different API availability

  • Updated security constraints

  • Changed performance characteristics

The guide focuses on maintaining script functionality while adapting to cloud-specific requirements.

Contents:

Table of Contents
minLevel1
maxLevel2
outlinefalse
styledefault
typelist
printabletrue

Prerequisites

  • Administrator access to both Jira DC and Jira Cloud instances

  • Inventory of existing Power Scripts

  • Knowledge of Simple Issue Language (SIL)

  • Understanding of cloud environment constraints

  • Review the Jira DC to Cloud script migration reference to learn which scripts migrate successfully and which scripts require readjustment.


Migration method

You can use an automated or manual migration method

If

.

Automated migration

For automated script migration, use a tool such as

the the is used to migrate from Data Center to Jira Cloud we can assume a number of things that will make the migration more successful

. When using a tool, the following consistencies help ensure script compatibility:

  • Project and issue type names

will be identical between DC and cloud - this will ensure that
  • remain exact matches between Jira DC and Jira Cloud. This ensures project keys or issue

types
  • type names used directly in scripts will continue to operate after migration.

  • Custom field names

will be identical - Custom field id’s will definitely not be identical. However, if
  • are preserved as exact matches between Jira DC and Jira Cloud, but custom field IDs will be different.

(
    • , which is a best practice

) then by updating
    • , you can update the SIL aliases settings in

cloud
    • Power Scripts for Jira Cloud. This way, the scripts will automatically work with the new

id’s
    • IDs.

    • If custom field aliases were not used

then this
    • , the migration is a good opportunity to

convert to
    • start using them.

  • Status and transition names

(etc.) will be identical - this will ensure that any
  • remain exact matches between Jira DC and Jira Cloud. This ensures scripts using status names, transition names, or

id’s
  • IDs should continue to operate after

the migration InfoIf JCMA or CMJ is not used in the migration
  • migration.

For details, see Script migration process.

Manual migration

If you aren’t using a migration tool, scripts can still be migrated by uploading them to the SIL manager or

using

through the Apps > Power Scripts > Self Help menu in Jira Cloud admin settings and then

by

configuring them manually.

Expand
titleSteps for manual script migration
Include Page
Jira Server/Data Center to Cloud migration
Jira Server/Data Center to Cloud migration


Script migration process

Expand
titleSteps for automated script migration
Include Page
Script migration process
Script migration process

Post-migration testing

After the migration, test your scripts by performing a syntax check in the SIL Manager (in Power Scripts for Jira Cloud).

If a script passes the syntax

check from the SIL Manager

test, it means

the following

that:

  • The functions

used
  • shown in

the
  • this code are compatible

between
  • with both Jira DC and

cloud
  • Cloud environments.

  • The syntax of the script it correct.

  • Custom field

id’s
  • IDs are correct or have been updated in the alias file

What it
  • .

Note

Passing the syntax test does not mean

:That

the script will operate exactly the same way between Jira DC and

cloud InfoThe reason that the

Jira Cloud.

Some scripts may not

operated exactly the same

work identically between DC and cloud

has to do with the information that may be contained in the script. Project

environments and can require adjustments due to differences in project names, issue type names, JQL queries,

(etc.) may have to all be adjusted in order to guarantee the script will operate as expected. Using a migration tool will increase the likelihood of success.
Note

We recommend that scripts will need to be tested post migration for the reasons mentioned above.

Which scripts will migrate from DC to Cloud

Expand Include PageWhich scripts will migrate from Jira DC to Jira CloudWhich scripts will migrate from Jira DC to Jira Cloud

Scripts that will need changes when migrating

Conditions and validator scripts

Conditions and validators are written using a language/syntax called Jira Expressions in the cloud. All truly

or other script-contained information. While using migration tools (JMCA or CMJ) improves the chances of successful script migration, these elements may still need to be adjusted to ensure the scripts operate in the cloud instance as expected.

Info

See the Jira DC to Cloud script migration reference to learn which scripts migrate from Jira DC to Cloud and which will require adjustment.

Note

To avoid issues in the target cloud environment, testing all scripts after the migration is strongly recommended.


Required post-migration script changes

When migrated between Jira DC and Jira Cloud, the following script types require additional changes: conditions and validator scripts, Live Fields, and mail handler scripts. In addition, all existing scripted JQL functions/keywords must be updated for Jira Cloud.

Conditions and validator scripts

Jira Cloud uses Jira Expressions language for conditions and validators; scripted conditions and validators are not currently supported in Jira Cloud

at this time. Many people find using Jira Expressions to be difficult and time consuming. Like other features in Cloud, the solution may be to look at the problem in a slightly different way and to tweak the solution. See this article for a solution

. While many users find Jira Expressions challenging and time-intensive to work with, there are alternative approaches. As with other features in Jira Cloud, rather than directly converting scripts and replicating Data Center solutions, consider rethinking your approach. To learn about ways to continue using SIL scripted conditions and validators in Jira Cloud, see this article.

Expand
titleJira Expressions example
Code Block
issue.issueType.name.match('^(Dev Task)$') == null || 
(issue.issueType.name.match('^(Dev Task)$') != null && 
issue.parent.subtasks.filter(subtask => subtask.assignee != null).length == 
issue.parent.subtasks.length)? true : false
Expand
titleSIL plus Jira Expressions example
Code Block
//SIL code
boolean passConditionValue = true;
if(issueType == "Dev Task") {
    for(string s in subtasks(parent)) {
        if(s.issueType == "Dev Task && isNull(s.assignee)) {
            passConditionValue = false;
        }
    }
}
setIssueEntityPropertyValue(key, "passCondition", passConditionValue);
Code Block
//Jira Expression
JSON.stringify(issue.properties['passCondition']).includes('true')

Live Fields scripts

In Data Center,

Live Fields works differently in Jira DC versus Jira Cloud.

In Jira DC

In Jira Cloud

  • Live Fields is a

just
  • collection of functions

within
  • in Power Scripts

that are used
  • .

  • Used to manipulate issue screens and

the
  • UI.

In Jira Cloud, Live Fields was built as separate app for architectural reasons. This new Live Fields app does not use the SIL language, instead it uses JavaScript or TypeScript. When writing scripts for Live Fields for Jira Cloud
  • Uses SIL language for scripting.

  • Live Fields is a standalone application.
    See Live Fields documentation for details.

  • It is built separately for Cloud architecture requirements.

  • Uses JavaScript/TypeScript instead of SIL.

  • Requires an API written by Atlassian

must be used. For this reason
  • .

Because of these differences, all Live Fields scripts

will need to

must be converted from SIL to JavaScript when migrating.

For example:

Example

Code Block
//SIL (Data Center)
lfSet("summary", "Value to set");

//JavaScript (Cloud)
getFieldById("summary").setValue("Value to set");

Mail handler scripts

It is important to note that the

The Power Scripts incoming email service

that is available in Power Scripts for Jira Cloud is different from Data Center in that it does not intercept emails coming in on the main “…@atlassian.net” email address. This is because it is currently not possible to intercept those emails as Atlassian has not made it possible to do so. In Jira Cloud, email scripts can

works differently in Jira Cloud than in Data Center. Due to Atlassian’s Cloud architecture, email scripts In Jira Cloud:

  • Cannot intercept messages sent to your primary Atlassian address (youremail@atlassian.net).

  • Can only intercept emails going to

a separate email account like a Gmail account for example.It is due to this difference above that different functions were needed between Data Center and Cloud for incoming email scripts. These scripts will need to be modified to use the new
  • an external email accounts, such as Gmail.

Due to the differences in email handling between DC and Cloud, email scripts require different functions in each environment. Existing DC email scripts must be updated to use the new Cloud-compatible functions.

Expand
titleData Center email handler script example
Code Block
IncomingEmail mail = getIncomingEmail();
string issueKey = matchText(mail.subject, "[A-Z][A-Z]+-[0-9]+"); // find an issue key in the subject
if(isNull(issueKey)) {
	// if no issue key found, create a new issue
    string [] fields = {};
    fields += {"reporter", currentUserKey()};
    fields += {"assignee", getUserByEmail(mail.cc[0]).key}; 
    string newIssue = createIssue("TEST", "", "Task", mail.subject, "Minor", mail.body, {}, "", "", 0, fields);
    attachAllFilesFromEmail(newIssue);
    %newIssue%.watchers = getUserKeysFromEmails(mail.cc); 
} else {
	// if issue key found in subject, add a comment
    addComment(issueKey, currentUserKey(), mail.body);
}
Expand
titleCloud incoming email processing script example
Code Block
IncomingEmail mail = getIncomingEmail();
string issueKey = mail.subject;
if(issueExists(issueKey)) {
    // add comment
    string commentText = mail.body;
    string userCommenting = getUserByEmail(mail.from).key;
    addComment(issueKey, userCommenting, commentText);
    attachAllFilesFromEmail(issueKey);
} else {
    // create issue
    string summary = mail.subject;
    string description = mail.body;
    string [] fields = {};
    fields += {"reporter", getUserByEmail(mail.from).key};
    createIssue("SCRUM", "", "Task", summary , "Minor", description, {}, "", "", fields);
}

Scripted JQL functions

/keywordsWith

and their keywords

When users write JQL queries that include custom scripted functionality (via keywords), Jira DC and Jira Cloud handle the execution of the scripted JQL functions/keywords

there is a large paradigm shift between Data Center and cloud that has to do with Jira directly and is not caused by Power Scripts.
  • In Data Center, scripted functions are executed when the search is executed. The SIL script performs its own, separate JQL search for each issue with the script determining if the issue should be included in the search results as each issue is evaluated one-by-one

  • In Cloud, scripted functions are executed in advanced of the search and the result of the script is stored with the issue. The JQL search uses these precalculated results to determine if the issue should be returned with the search results.

This will change the construction of the script JQL function/keyword in the following ways:

  • Scripts will not contain their own JQL search in the script

  • The return statement of the cloud scripts uses additional operations when compared to DC

  • JQL scripts in cloud

    in fundamentally different ways. This difference stems from Jira's core architecture, not from Power Scripts functionality.

    In Jira DC

    In Jira Cloud

    • The JQL scripts execute during the search operation when their associated keywords are used.

    • Each issue is evaluated individually through separate JQL searches.

    • Results are calculated in real-time when the JQL query runs.

    • The JQL scripts execute before the search operation.

    • Results are pre-calculated and stored with each issue.

    • When users run JQL queries with scripted keywords, Cloud references these pre-calculated and stored values to determine which issues to include in the results.

    These architectural differences require the following changes to JQL script construction for Jira Cloud:

    • Scripts no longer contain their own JQL searches within their code.

    • Return statements require additional Cloud-specific operations.

    • JQL scripts in Jira Cloud can update the search values of parent and child issues as well as

    their ownFor these reasons script JQL functions/keywords will need to
    • the value within the issue that triggered the script.

    Due to these differences in script execution, all existing scripted JQL functions must be updated to use the new cloud methods

    in cloud.

    Script Migration Process/Strategy

    Include PageScript migration processScript migration processUseful scripts, tips and tricks

    , even though the keywords users type in their JQL queries remain the same.


    Converting Groovy scripts to SIL

    If your migration plan includes converting Groovy scripts to SIL, familiarize yourself with the key differences between the Groovy and SIL approaches to scripting.

    Expand
    titleGroovy to SIL conversion guidelines
    Include Page
    Converting Groovy scripts to SIL
    Converting Groovy scripts to SIL

    Jira DC to Cloud script migration reference

    Learn more about which scripts migrate successfully from Jira DC to Cloud and which scripts will require adjustment.

    Expand
    titleSee reference
    Include Page
    Jira DC to Cloud script migration reference
    Jira DC to Cloud script migration reference

    Useful tools and scripts for post-migration script adjustment

    Include Page
    Useful tools and scripts for post-migration script adjustment
    Useful tools and scripts for post-migration script adjustment

    Table of contents:

    Table of ContentsminLevel1maxLevel2outlinefalsestylenonetypelistprintabletrue