# ScriptRunner

**URL:** https://forum.library.adaptavist.com/c/scriptrunner/5.md?page=1

[Latest](https://forum.library.adaptavist.com/latest.md) · [Categories](https://forum.library.adaptavist.com/categories.md) · [Tags](https://forum.library.adaptavist.com/tags.md)

**Page:** 2

---

## [Concealing Panels and Page Properties: A Script Runner Approach](https://forum.library.adaptavist.com/t/concealing-panels-and-page-properties-a-script-runner-approach/451)

<div class="topic-metadata">

**Author:** [@rwat090](https://forum.library.adaptavist.com/u/rwat090)\
**Replies:** 2\
**Last updated:** [April 6, 2024, 1:09am UTC](https://forum.library.adaptavist.com/t/concealing-panels-and-page-properties-a-script-runner-approach/451 "2024-04-06T01:09:00Z")

</div>

I’m trying to conceal certain panels or page properties items across 300 confluence pages. These pages were generated using a template, but the template is malfunctioning with several problems. I’m considering using Scri…

---

## [hasLinkType - Query ScriptRunner](https://forum.library.adaptavist.com/t/haslinktype-query-scriptrunner/448)

<div class="topic-metadata">

**Author:** [@jdumascentersplan](https://forum.library.adaptavist.com/u/jdumascentersplan)\
**Replies:** 1\
**Last updated:** [April 5, 2024, 5:01am UTC](https://forum.library.adaptavist.com/t/haslinktype-query-scriptrunner/448 "2024-04-05T05:01:01Z")

</div>

What would be a similar query I could use in the cloud instance? project = XYZ and status = “In Development” and not issueFunction in hasLinkType(“Development”)

---

## [Transition Condition Script Returns false but Transition is Still Available](https://forum.library.adaptavist.com/t/transition-condition-script-returns-false-but-transition-is-still-available/436)

<div class="topic-metadata">

**Author:** [@candrade](https://forum.library.adaptavist.com/u/candrade)\
**Replies:** 5\
**Last updated:** [February 27, 2024, 1:10pm UTC](https://forum.library.adaptavist.com/t/transition-condition-script-returns-false-but-transition-is-still-available/436 "2024-02-27T13:10:31Z")

</div>

I added a condition to a transition using the custom script condition option \[ScriptRunner\], but the transition is still available on the issue screen. I simplified the script to just “return false” to make sure but the …

---

## [Open a Pop Up Window when IssueLinkDeletedEvent is fired](https://forum.library.adaptavist.com/t/open-a-pop-up-window-when-issuelinkdeletedevent-is-fired/432)

<div class="topic-metadata">

**Author:** [@sumeet3100](https://forum.library.adaptavist.com/u/sumeet3100)\
**Replies:** 4\
**Last updated:** [February 21, 2024, 12:43pm UTC](https://forum.library.adaptavist.com/t/open-a-pop-up-window-when-issuelinkdeletedevent-is-fired/432 "2024-02-21T12:43:08Z")

</div>

Hello All, We want to open a Screen to take the approval when some is deleting the linked issue. Can, I please get some guidance on this topic.

---

## [Using Scripts and Script Editor with Scriptrunner](https://forum.library.adaptavist.com/t/using-scripts-and-script-editor-with-scriptrunner/425)

<div class="topic-metadata">

**Author:** [@Marcus](https://forum.library.adaptavist.com/u/Marcus)\
**Replies:** 3\
**Last updated:** [February 21, 2024, 12:36pm UTC](https://forum.library.adaptavist.com/t/using-scripts-and-script-editor-with-scriptrunner/425 "2024-02-21T12:36:50Z")

</div>

Hey all, I am using Groovy Scripts saved to the instance machine, which I call with my Post Functions, e.g. creating sub-tasks. But I often experience that when I save changes in the web Script Editor, that comes with …

---

## [Get a specific attribute value from Assets](https://forum.library.adaptavist.com/t/get-a-specific-attribute-value-from-assets/282)

<div class="topic-metadata">

**Author:** [@roliveira](https://forum.library.adaptavist.com/u/roliveira)\
**Replies:** 2\
**Last updated:** [January 30, 2024, 2:11pm UTC](https://forum.library.adaptavist.com/t/get-a-specific-attribute-value-from-assets/282 "2024-01-30T14:11:30Z")

</div>

I have a Custom Field of type Assets objects in which I need to use the Expiration Date attribute (Data Vencimento Bombeiros) to create an alert. How do I get this date, given that all attributes appear in the JSON with…

---

## [Check asset attribut changes](https://forum.library.adaptavist.com/t/check-asset-attribut-changes/424)

<div class="topic-metadata">

**Author:** [@crazzers](https://forum.library.adaptavist.com/u/crazzers)\
**Replies:** 0\
**Last updated:** [January 25, 2024, 12:23pm UTC](https://forum.library.adaptavist.com/t/check-asset-attribut-changes/424 "2024-01-25T12:23:33Z")

</div>

Hello, i already wrote a automation that transitions an inusse when an asset attribut changes. Theres no good trigger for this automation though so at the moment i let it run every 5 minutes. Is it possible to send a we…

---

## [Assitance, Struggling to get this script to work](https://forum.library.adaptavist.com/t/assitance-struggling-to-get-this-script-to-work/420)

<div class="topic-metadata">

**Author:** [@sean.mcconnell](https://forum.library.adaptavist.com/u/sean.mcconnell)\
**Replies:** 0\
**Last updated:** [January 18, 2024, 10:25pm UTC](https://forum.library.adaptavist.com/t/assitance-struggling-to-get-this-script-to-work/420 "2024-01-18T22:25:35Z")

</div>

This script is to check for Duplicate Ticket with same Summary name that are open. Link the duplciate ticket and close. def issueSummary = issue.fields.summary logger.info('issue summary is : ' + issueSummary) def jqlS…

---

## [Search last comment for a string?](https://forum.library.adaptavist.com/t/search-last-comment-for-a-string/418)

<div class="topic-metadata">

**Author:** [@wstewart3](https://forum.library.adaptavist.com/u/wstewart3)\
**Replies:** 0\
**Last updated:** [January 10, 2024, 5:12pm UTC](https://forum.library.adaptavist.com/t/search-last-comment-for-a-string/418 "2024-01-10T17:12:18Z")

</div>

I have some automation that is being triggered by JQL. However I only want it to trigger if the LAST comment on the issue contains a string (Lets say “test”). Is there a way to do this with scriptrunner? I found: htt…

---

## [Needs help to make my script work](https://forum.library.adaptavist.com/t/needs-help-to-make-my-script-work/415)

<div class="topic-metadata">

**Author:** [@Zaldy](https://forum.library.adaptavist.com/u/Zaldy)\
**Replies:** 10\
**Last updated:** [January 9, 2024, 11:07pm UTC](https://forum.library.adaptavist.com/t/needs-help-to-make-my-script-work/415 "2024-01-09T23:07:22Z")

</div>

Hi everyone. I hope some could help with my issue on the script below. Every time I do a test run, the validation condition always end up on the last ELSE block; and it is not process the rest of the code – i.e., the up…

---

## [ScriptRunner Cloud JSON parsing and formatting](https://forum.library.adaptavist.com/t/scriptrunner-cloud-json-parsing-and-formatting/414)

<div class="topic-metadata">

**Author:** [@kcwong](https://forum.library.adaptavist.com/u/kcwong)\
**Replies:** 0\
**Last updated:** [December 15, 2023, 8:54am UTC](https://forum.library.adaptavist.com/t/scriptrunner-cloud-json-parsing-and-formatting/414 "2023-12-15T08:54:52Z")

</div>

Since import statement is not working in Cloud ScriptRunner, how do I do JSON parsing and construction? Unirest has some JSON-related classes like JsonNode (you can parse valid JSON with this one), but other classes lik…

---

## [How do I change field's rendering method via script?](https://forum.library.adaptavist.com/t/how-do-i-change-fields-rendering-method-via-script/413)

<div class="topic-metadata">

**Author:** [@t0m1slav](https://forum.library.adaptavist.com/u/t0m1slav)\
**Replies:** 1\
**Last updated:** [December 14, 2023, 7:59pm UTC](https://forum.library.adaptavist.com/t/how-do-i-change-fields-rendering-method-via-script/413 "2023-12-14T19:59:59Z")

</div>

Hello, How do I change field’s rendering method via script? I tried everything, and there is not much examples for this. I have a field that is used in multiple field configurations. I’d like to change its rendering m…

---

## [How do I update 2 custom Jira fields at a time?](https://forum.library.adaptavist.com/t/how-do-i-update-2-custom-jira-fields-at-a-time/408)

<div class="topic-metadata">

**Author:** [@Zaldy](https://forum.library.adaptavist.com/u/Zaldy)\
**Replies:** 6\
**Last updated:** [December 14, 2023, 2:36am UTC](https://forum.library.adaptavist.com/t/how-do-i-update-2-custom-jira-fields-at-a-time/408 "2023-12-14T02:36:43Z")

</div>

Hi all, Thanks for reading my query. And hope someone could help me with my trivial question… I got 3 custom fields: Issue category - which is a cascading field (customfield\_10220) Functional area - single picklist (…

---

## [Automate changes to ScriptRunner objects](https://forum.library.adaptavist.com/t/automate-changes-to-scriptrunner-objects/409)

<div class="topic-metadata">

**Author:** [@kcwong](https://forum.library.adaptavist.com/u/kcwong)\
**Replies:** 0\
**Last updated:** [December 12, 2023, 11:18am UTC](https://forum.library.adaptavist.com/t/automate-changes-to-scriptrunner-objects/409 "2023-12-12T11:18:26Z")

</div>

I have a lot of scripts to rewrite for cloud migration. I will be rewriting those scripts in Eclipse, and when I’m done rewriting, I’d like to have an automated way to deploy them. I notice the web UI is making calls t…

---

## [Code Reuse for Cloud](https://forum.library.adaptavist.com/t/code-reuse-for-cloud/407)

<div class="topic-metadata">

**Author:** [@kcwong](https://forum.library.adaptavist.com/u/kcwong)\
**Replies:** 1\
**Last updated:** [December 8, 2023, 7:53am UTC](https://forum.library.adaptavist.com/t/code-reuse-for-cloud/407 "2023-12-08T07:53:00Z")

</div>

For Server/Data Center, there’s the Script Editor menu to write scripts for reuse. In Cloud, there’s no more Script Editor. How can I achieve the same effect? In particular, I want paging to be handled transparently. If…

---

## [Round Robin Issue Assignment (ScriptRunner for JIRA Cloud)](https://forum.library.adaptavist.com/t/round-robin-issue-assignment-scriptrunner-for-jira-cloud/404)

<div class="topic-metadata">

**Author:** [@Commcast](https://forum.library.adaptavist.com/u/Commcast)\
**Replies:** 0\
**Last updated:** [December 6, 2023, 5:30am UTC](https://forum.library.adaptavist.com/t/round-robin-issue-assignment-scriptrunner-for-jira-cloud/404 "2023-12-06T05:30:10Z")

</div>

Overview Assign issues to the members of a project in a ‘round robin’ manner. This script automatically assigns the next user in the list to each newly created issue. Good to Know This script has been designed to wor…

---

## [Calling built in scripts from ScriptRunner?](https://forum.library.adaptavist.com/t/calling-built-in-scripts-from-scriptrunner/402)

<div class="topic-metadata">

**Author:** [@MoonShine](https://forum.library.adaptavist.com/u/MoonShine)\
**Replies:** 1\
**Last updated:** [November 27, 2023, 8:25am UTC](https://forum.library.adaptavist.com/t/calling-built-in-scripts-from-scriptrunner/402 "2023-11-27T08:25:18Z")

</div>

Hello, I have a need to automate creation of spaces and I’m looking for a way to call the built in script “Copy Space” (since I have a few different “blueprint spaces” that I would like to use for the spaces. I have not …

---

## [Need help on copying custom field to another custom field](https://forum.library.adaptavist.com/t/need-help-on-copying-custom-field-to-another-custom-field/399)

<div class="topic-metadata">

**Author:** [@Zaldy](https://forum.library.adaptavist.com/u/Zaldy)\
**Replies:** 9\
**Last updated:** [November 24, 2023, 8:23am UTC](https://forum.library.adaptavist.com/t/need-help-on-copying-custom-field-to-another-custom-field/399 "2023-11-24T08:23:37Z")

</div>

Hi all, My first post here. Being new to ScriptRunner, I wanted to create couple of scripts as replacement for our Jira Service Management automation rule. The first requirement is: One create or edit, update the Appr…

---

## [Setting default value on Asset custom field (multiple checkbox) using a ScriptRunner Behavior](https://forum.library.adaptavist.com/t/setting-default-value-on-asset-custom-field-multiple-checkbox-using-a-scriptrunner-behavior/400)

<div class="topic-metadata">

**Author:** [@mattd](https://forum.library.adaptavist.com/u/mattd)\
**Replies:** 0\
**Last updated:** [November 22, 2023, 7:31pm UTC](https://forum.library.adaptavist.com/t/setting-default-value-on-asset-custom-field-multiple-checkbox-using-a-scriptrunner-behavior/400 "2023-11-22T19:31:21Z")

</div>

ScriptRunner 8.16.0 JSD 5.4.11 Hello, I can’t get an Asset custom field (multiple checkbox) to populate with default values using a ScriptRunner Behavior in JSD in Data Center. The script is basic, I’m just trying to…

---

## [How to Create a Jira Workflow Condition that only allows the transition if there has been a pull request](https://forum.library.adaptavist.com/t/how-to-create-a-jira-workflow-condition-that-only-allows-the-transition-if-there-has-been-a-pull-request/388)

<div class="topic-metadata">

**Author:** [@Cash](https://forum.library.adaptavist.com/u/Cash)\
**Replies:** 0\
**Last updated:** [October 12, 2023, 2:26pm UTC](https://forum.library.adaptavist.com/t/how-to-create-a-jira-workflow-condition-that-only-allows-the-transition-if-there-has-been-a-pull-request/388 "2023-10-12T14:26:46Z")

</div>

In Jira Cloud, How can I Create a Jira Workflow Condition using a ScriptRunner Script as the condition in a workflow transition that only allows the transition if there has been a pull request?

---

## [All time logged on epic and underlying stories and subtasks](https://forum.library.adaptavist.com/t/all-time-logged-on-epic-and-underlying-stories-and-subtasks/382)

<div class="topic-metadata">

**Author:** [@Carson19](https://forum.library.adaptavist.com/u/Carson19)\
**Replies:** 0\
**Last updated:** [September 21, 2023, 4:50pm UTC](https://forum.library.adaptavist.com/t/all-time-logged-on-epic-and-underlying-stories-and-subtasks/382 "2023-09-21T16:50:55Z")

</div>

Hello there. Wondering if anyone can help as I need a scripted field that stores the total time logged on an epic as well as all children of the epic and all subtasks of those children. I’ve got a script which sums the t…

---

## [Jira Automation firing Scriptrunner script action](https://forum.library.adaptavist.com/t/jira-automation-firing-scriptrunner-script-action/366)

<div class="topic-metadata">

**Author:** [@Marcus](https://forum.library.adaptavist.com/u/Marcus)\
**Replies:** 4\
**Last updated:** [August 28, 2023, 6:24am UTC](https://forum.library.adaptavist.com/t/jira-automation-firing-scriptrunner-script-action/366 "2023-08-28T06:24:28Z")

</div>

Hey all, It’s probably just something ■■■■■■ thing I am missing or overseeing. I have jira automation watching for a fieldchange which then fires an Scriptrunner script which should fill a radiobuttons customfield base…

---

## [Updating the creator](https://forum.library.adaptavist.com/t/updating-the-creator/373)

<div class="topic-metadata">

**Author:** [@kwhitake](https://forum.library.adaptavist.com/u/kwhitake)\
**Replies:** 0\
**Last updated:** [August 25, 2023, 1:28pm UTC](https://forum.library.adaptavist.com/t/updating-the-creator/373 "2023-08-25T13:28:08Z")

</div>

Hi! We just migrated from a couple instance into one instance and put everyone on single sign on. In the process, we had to update the user name which changed the creator to a user-(5 digit #) I wanted to use the bui…

---

## [Web panel condition is failing](https://forum.library.adaptavist.com/t/web-panel-condition-is-failing/370)

<div class="topic-metadata">

**Author:** [@Washieq](https://forum.library.adaptavist.com/u/Washieq)\
**Replies:** 0\
**Last updated:** [August 25, 2023, 7:51am UTC](https://forum.library.adaptavist.com/t/web-panel-condition-is-failing/370 "2023-08-25T07:51:13Z")

</div>

Dear team, recently after updating JIRA conditions for the webpanels stopped to work. Snippet of condition: def key = jiraHelper.contextParams.issue.key log.warn("key = ${key}") def issueTypeId = jiraHelper.contextPar…

---

## [Tracking work logged on tickets](https://forum.library.adaptavist.com/t/tracking-work-logged-on-tickets/368)

<div class="topic-metadata">

**Author:** [@ScottCurwood](https://forum.library.adaptavist.com/u/ScottCurwood)\
**Replies:** 0\
**Last updated:** [August 24, 2023, 10:55pm UTC](https://forum.library.adaptavist.com/t/tracking-work-logged-on-tickets/368 "2023-08-24T22:55:57Z")

</div>

We are EXTREMELY novices with ScriptRunner and I’m looking for a way to pull in the work logged on Jira tickets by a group of asignee’s over a set period of time. We run Sprints but they don’t display work logged only w…

---

## [Retrieve attributes from Insight](https://forum.library.adaptavist.com/t/retrieve-attributes-from-insight/365)

<div class="topic-metadata">

**Author:** [@Marcus](https://forum.library.adaptavist.com/u/Marcus)\
**Replies:** 1\
**Last updated:** [August 23, 2023, 9:45am UTC](https://forum.library.adaptavist.com/t/retrieve-attributes-from-insight/365 "2023-08-23T09:45:10Z")

</div>

Heya, I am working my way through https://docs.adaptavist.com/sr4js/latest/hapi/work-with-assets-insight but when I use Assets.getAttributeValues() I get MissingMethodException. My goal is to set a CustomField based on…

---

## [Issue or Project context in Custom Picker Scripted Field?](https://forum.library.adaptavist.com/t/issue-or-project-context-in-custom-picker-scripted-field/364)

<div class="topic-metadata">

**Author:** [@oaustegard](https://forum.library.adaptavist.com/u/oaustegard)\
**Replies:** 3\
**Last updated:** [August 23, 2023, 8:24am UTC](https://forum.library.adaptavist.com/t/issue-or-project-context-in-custom-picker-scripted-field/364 "2023-08-23T08:24:35Z")

</div>

For a Custom Picker scripted field is there any way to access the issue or project context of the field, similar to the issue which is available in a standard scripted field? The following code (or similar for an issue …

---

## [Execute Groovy Script on Jira Restart](https://forum.library.adaptavist.com/t/execute-groovy-script-on-jira-restart/255)

<div class="topic-metadata">

**Author:** [@krishnanayak](https://forum.library.adaptavist.com/u/krishnanayak)\
**Replies:** 2\
**Last updated:** [August 23, 2023, 8:12am UTC](https://forum.library.adaptavist.com/t/execute-groovy-script-on-jira-restart/255 "2023-08-23T08:12:46Z")

</div>

We are currently building a script plugin. As part of this, we have one script that will utilize the example Store all Environment Specific Variables and should be run everytime Jira is restarted. How do i achieve this?…

---

## [Behaviour: Validation on FieldChange - how to get originalIssue Value?](https://forum.library.adaptavist.com/t/behaviour-validation-on-fieldchange-how-to-get-originalissue-value/346)

<div class="topic-metadata">

**Author:** [@Man](https://forum.library.adaptavist.com/u/Man)\
**Replies:** 1\
**Last updated:** [August 22, 2023, 12:41pm UTC](https://forum.library.adaptavist.com/t/behaviour-validation-on-fieldchange-how-to-get-originalissue-value/346 "2023-08-22T12:41:47Z")

</div>

Hi, I want to create a field check in a behaviour. When the field “duedate” is changed, i want to validate if the new value is in the future. If it’s not changed, it can be also in the past. As far as i know i canno…

---

## [List Project Role membership](https://forum.library.adaptavist.com/t/list-project-role-membership/360)

<div class="topic-metadata">

**Author:** [@chris.melville](https://forum.library.adaptavist.com/u/chris.melville)\
**Replies:** 0\
**Last updated:** [August 15, 2023, 10:32pm UTC](https://forum.library.adaptavist.com/t/list-project-role-membership/360 "2023-08-15T22:32:56Z")

</div>

Found an old script to do this that needed refreshing. In so doing, I discovered the “ProjectRolePicker” dynamic form field type does not work on my test instance that has an expired license, although the ProjectPicker …

[Previous page](https://forum.library.adaptavist.com/c/scriptrunner/5.md)

[Next page](https://forum.library.adaptavist.com/c/scriptrunner/5.md?page=2)
