Scriptrunner get issue by key. key == "TheKey" && issue.
Scriptrunner get issue by key setFormValue(contextIssue. Below is my JQL: issueFunction in parentsOf ("project = RDPMS and issuekey = RDPMS-8") Hello Community, I am having a bit of trouble with Behaviours. Scriptrunner - getting linked issues; Scriptrunner - getting linked issues . Previewing is useful to verify that the picker is only displaying the correct candidate issues. ScriptRunner for Jira - Get all issue type schemes and issue types; ScriptRunner for Jira - Get all project permissions; ScriptRunner for Jira - Get fields on a screen; ScriptRunner for Jira - Get list of projects, issue types, components, lead, version and category; ScriptRunner for Jira - Get projects from issue types; ScriptRunner for Jira The issue key is mapped to custom field as "TT-56" import com. Especially the behaviours section. Getting Hi David. key}} which will get you the actual issue key if it involves branching Using Groovy scripts in Jira Software/Core or Service Management (Server/Data Center) adds a huge amount of new possibilities in customizing workflows, enhancing the user experience and automating processes. Hi, I would like to add the issue key at the beginning of the summary and the epic name when an issue is created in the project called SR. From the Mock 5 issue, the total Story Points used is 12, as shown below:- Wanting to get the old issue key after movement in a field. Have you tried using this query: status != Done AND issueFunction IN linkedIssuesOf("key = ABC-1", "is blocked by") In your You can find the ID by right-clicking on the custom field in the issue edit screen and selecting Copy ID. key comes out as null. In this example we enter object HAVING connectedTickets(key = {{issue. getIssueByID() is applicable for argument types: (java. key}</a>""" config. setReadOnly(false) getFieldById("versions"). name Hi Rika, If you are using the Post-Function, you should use the Issue's key variable, i. December 12, // the issue key here def value = (String) issue. Issue import com. underlyingIssue. This field collects the sum of the value of a field called PX: Cost of a ticket with the value of the PX: Change Request Cost field that contains the subtasks. GenericValue> getEntitiesByIssue (String relationName, org. I know script runner is the way for it, but i cant seem to find the script for it. 13. getCustomFieldValue(customField) log. The issue variable above is a standard com. I've found the post function to transition a parent when a subtask transitions, but I would like the entire hierarchy to transition as well - Sub-task, Story and Epic. summary) issue. I would like to know if there is a way to grab the contents of an Issue if you know the name of an Issue. Select the Settings cog in the top right-hand corner of the screen. ScriptRunner Groovy script - Tested on script console HAPI is an API (application programming interface) for doing common tasks in Jira, including managing issues, searching for issues, updating fields and much more! HAPI is a simple alternative to Jira's regular API and can be used in your Groovy scripts. project. 0. name Let us learn how to fetch issue fields and do logging. As you see, I have to use three different built-in functions of ScriptRunner to get the next lower hierarchical level. #### Example Iterate over issues matching JQL in order to update them, or add a comment etc. My next issue is how to stop the code snippet showing up in the email from the template as raw text. key). 1: ScriptRunner setup: Breaking change in Az. It already exists as a prepopulated variable with name issue. get Sorry I did not get you. jsr223. I already have written a Hi Alex, Thank you for your question. warn("Resolved issue '${issue}'. getKey() Something like this should work if you are fetching from an event. key} in the query. getCustomFieldObject ("customfield_13206") Hello Community, I am having a bit of trouble with Behaviours. but i will using this script to provide my end user with a pre-filled date value based on the linked issue, when they add the issues to the form issuelinks‘s field issuelinks-issues, and the linktype is "is blocked by ". I want to set the Security Level for the current issue object in Behaviour. Once you fetch those linked issues you can then do lot of things with them like updating them, transitioning Hello, I am creating a global Jira Automation rule in script runner. Example I have been working on multiple issues; however, I now need to move these issues into an epic. So if you want to handover information from a script and you Hi Prakhar, Thank you for your advice. summary, issue. e "blocks" or "is caused by". CustomField import com. key If you are speaking of using automation for JIRA (this is different from scriptrunner), consider using {{issue. So if you want to handover information from a script and you have limited space it's best to just send the issue key and then get the issue object by key. In part 4 we used the newly created dialog I use actual project key from our Jira instance - the "JIRA-1234" and "KEY-1234" are just examples. key; log. All the variables that are related to issue, event, user, etc that are applicable for the functionality where you are writing the script. From there I would like to use the name of the Is #### Overview Use this snippet to search for issues using JQL. Watch. everything else works fine, im able to set name, summary, tittle, prio, description, assign reporter, projectkey, issue context, and issue type. 9 and Script Runner version 5. updateValue(null, issue, new ModifiedValue(issue. Hence my goal is to link the all issues from the issuetype A to an issue of the issuetype B, if the assignee is the same (and some other conditions - but it doesnt matter for I guess we are back to the original question --how to get an "issue" in the ScriptRunner console w/o hard-coding the issue key? The subsequent code will be used as a post function so the followup to the above question is, after getting the code to work in ScriptRunner, how to modify the code (if modification needed) to run as a post-function? Scroll to Miscellaneous and select Lookup Asset (Insight) object from AQL (IQL) with ScriptRunner. 18. key. ScriptRunner get custom field value - Custom Listener Script . getFieldById("issuelinks-linktype") will return a String, i. Ask a question . projectKey = ruleContext. From there I would like to use the name of the Is I've created a Scriptrunner scripted field called Parent Issue Key. JIRAUSER00000). e. sparxsys. Fields ; Modifier and Type Field and Description; static IssueContext: GLOBAL. You can find the ID by right-clicking on the custom field in the issue edit screen and selecting Copy ID. Laria. issue. com/sparx Then we get the Issues linked to the child/story issue and loop through them. Partner. IssueInputParameters import com. channel. def cf = ComponentAccessor. dD. customField. I have both the username and the jira user key (i. I know this question was already answered but I just wanted to share some information that might be helpful to others who are not groovy developers and are just looking for a solution to their problem. getCustomFieldManager(). Note: Unfortunately there isn't a "getConfigParam" to get the current JQL. scriptrunner. key), to dynamically set the current issue key. I'm finding a lot of articles for how to get the username from the full name, but I want to do the opposite because I want to d Can you go to the Manage add-ons page, find Scriptrunner, click it to expand the Scriptrunner section and then expand the section that says "xxx of xxx modules enabled" Then check to see if the " Behaviour admin assets (bh-admin) " module is enabled or disabled? Returns an issue that has been moved by searching on the old issue key. You must A context (scope) for an issue or custom field. If it is from a workflow, they a simple issue. Ask a question {issue. name return issueproject Become my channel member: https://www. For example : on the create issue page I enter this info. I could, possibly, set the project key as a Issue Description Relevant product versions Area; Hangfire jobs get stuck and Azure Key Vault deadlocks occur: A bug in the . jira. Help is very much appreciated. Release 3, I need the display value 'Rel I am writing a Groovy script in Scriptrunner for Jira. 3 answers 1 accepted 10 votes . Scriptrunner issue picker JQL does not support (to the best of my knowledge) any placeholder to reference the current issue. i found that, when i add one issue to the form, Let us write a code to fetch the linked issues. Get field display value from a specific view. 2. It provides administrators with an in-line editor Which will result in: Reading the value. This will provide all the Thanks, Scott! REST API browser is a cool tool! :) Unfortunately this operation (api/1. Scripts can be useful for automating regular actions, such as updating an issue during a transition or performing a calculation and storing the result in a custom field on the issue. If you are bulk updating issues you may not want other users to receive notifications of this update. IssueManager import com. The only way to get only the issues linked to the current issue is to use dynamic JQL. Scriptrunner does have the "issuefunction in" functionality that has a number of functions, including issuesInEpics(), which allows you to put in a sub-query that will return any issues whose parent Epics meet a It should be possible to get the current issue in a behaviour. Can someone please help ? Hello, I am trying to create a rest endpoint script that retrieves an issue key and then writes this key to a separate text file. value += 1} logger. A search will return a pile of issues, and you can then look through the results to see if the issue or issues you are interested in are there. 8. Depending on the complexity of the script you will need to test with multiple issues and different inputs. 1. Lubomir Styskala. debug("This will appear in Scriptrunner logs"); // Modify this to be the issue key you want to examine: def issueKey = "PROJECTKEY-1"; // Get an instance of the Issue Manager def issueManager = ComponentAccessor. How can I assign the issue object to a specific issue by ID? I would expect something like: def issue = getIssueByID("JRA-123") so that I can then do stuff like: def def myIssue = event. com/joinLet us write a simple Groovy code today to fetch issue details and also take a look at the new script ScriptRunner: Iterating through an issue filter to calculate number of issue created by person . getLogger("com. NET Runtime framework leads to stuck Hangfire jobs and Azure Key Vault deadlocks. ; Select Macros under ScriptRunner. Turn on suggestions. Parameters: Line 10: Take each issue and group them by project key. class). transition The values (including fix version) are added by ScriptRunner scripts. issueType. cancel. #GetIssueFields #ScriptRunnerCloudEndpoint: GET /rest/api/3/issue/cts-12Code: https://github. component. /browse/${issue. transform. If PROG-1 is your master and will have Programmes linked to it, it should give you that full hierarchy when new links are added. From our initial script we are checking different field like: issue IssueType issue assignee issue assignee DisplayName : Actually I am retrieving for instance the information Solved: Hello, I recently went through my custom fields that are driven by scripted fields through scriptrunner and added a context to reduce the. debug "issue Type: " + issue. If you issuelinks as the identifier it will make both the direction and the issues readonly, required, etc, eg: import com. fixVersions*. Get the Previous Issues Key in a field using ScriptRunner in Jira Cloud. groovy. def issue = issueManager. here my code : import Issue when converting DocumentIssueImpl in MutableIssue on Scriptrunner; Issue when converting DocumentIssueImpl in MutableIssue on Scriptrunner String jql = 'key = TTD-1'; boolean doSearch No sign in the ScriptRunner documentation. In my JIRA instance, there are multiple projects, using version naming conventions that are identical. Below is the Sprint Board which displays the issues from which the Story Points will be extracted . com/sparx Key highlights of the app The must-have app for Jira admins of every technical background: Get creative control of your Jira issues without the heavy lifting. Long) values: [92197] In my Jira instance, I created a Script Listener for the IssueUpdated event using the ScriptRunner add-on and I'm trying to get a list of the changed fields. It it possible to get the current status of an issue in a behaviour? Thanks. rest. Is there possibility to solve it simpler? The portfolio built-in function childIssuesOf works over all hierarchal levels but can only be called with one issue key as parameter. key}}') Issues. import com. Chris Shepherd. In the email I would like to add a button which links to the issue, is. any help would be greatly appreciated. Install at least . Issue. Ask a question "The field '<custom field name>' does not have value for issue <Project key>-<key> and will not be displayed on the view issue page Overview Automatically bulk update the epic link of a set of issues. Let us learn how to fetch issue fields and do logging. But here is next issue I will need help with: The mentioned webhook is asking the information as POST, so it seems I can call the webhook with query parameters but rather I need to create a small ScriptRunner REST ENDPOINT and from that I've to pass issue details as I've realized it's possible to add an AND using && and maybe check for a certain issueType like jiraHelper. getIssueObject("INF-39") Hi @Humberto Gomes. January 30, 2018 . bound variable. BaseScript @BaseScript FieldBehaviours behaviours def reporter = getFieldById (fieldChanged) def reporterValue = Which will result in: Reading the value. That definitely helped to populate the issuekey in the URL. name; Hi, I am the product manager for an add-on called Power Scripts that lets you create the same type of automation as Script Runner. Solved: I am using Groovy in Scriptrunner. getKey() By adding the scriptline below updates only the value which we defined manually. Learn how to manipulate these custom fields to create custom dialog that derives data. ; Enter an optional Description, like Get the issue ID and issue summary on your I am trying to use listeners to avoid using the asset automations in Jira service management. key + " old reqver " + SourceReqValue) def changeHolder = new DefaultIssueChangeHolder(); Scriptrunner console get the value of a customfield . Issue Issue issue=issue def key=issue. The most powerful App in this area is ScriptRunner for Jira. Worklog def issue = context. getLoggedInUser(). the new working code to get the epic link value replaces what is under the comment: // CHECK TO SEE IF THE SOURCE ISSUE ALREADY HAS AN EPIC LINK I am writing a Groovy script in Scriptrunner for Jira. getCustomFieldValue(incidentAssetCf) as List Add issue key to Summary and Epic Name in a ScriptRunner post function . To get the value of the Linked Issues field, you can do the following: ScriptRunner JQL Query to Find Linked Issues of "is blocked by" AND Linked Issues' Status != Done I could get ALL issues' blockers but couldn't get ONLY blockers for ONLY 1 specific issue. the key for the duplicated fragment is suffixed with the first available number. March 3, 2020 . This will do the same as above with the search and history, but of just returning the list of users, we add the user to a Map object with the key being the username and the value being an array of issues that the user has modified in the last 30 days. key}}). The issue is created perfectly - I just want to send the Key of the created issue over Slack/Teams/Email without using JQL/Lookup to fetch it. The issue is created successfully and also linked with Issue link type "relates to". It provides administrators with an in-line editor where you can write groovy scripts. With that, you can use the information to perform other script runner functions Entity properties You can find the ID by right-clicking on the custom field in the issue edit screen and selecting Copy ID. getKey(). ticketLink = link. Avoiding notifications and event dispatches. You can directly access it to e. Does anyone know how to get the ProjectKey and ProjectName of the newly created Matthew, Thank you for the update. description. Line 13: Turn the result into a string for display. You can use Behaviours to work with the Linked Issues field, similar to how you work with other fields. I implemented this with a Listener in Scriptrunner with the ProjectCreatedEvent. Write a proper postfunction if you want to implement it for every issue on creation or take the easier route below: Fire a custom event on creation e. summary = 'Cloned Issue ' + sourceIssue. getIssueManager() def issue = issueManager. * After successful clone, currently we are displaying message "Issue has been created successfully". create(projectKey , 'Bug') { setSummary('My Issue Sum ScriptRunner UI Fragments have been created to simplify the creation of plugin modules described in the web fragments for Jira documentation. If the parent ticket has subtasks, I wa Hi David. Rising Star. ScriptRunner UI Fragments have been created to simplify the creation of plugin modules described in the web fragments for Jira documentation. I'm liking it though. Previous to this fix, if you had a handler listening for the Issue Assigned event, To get the list of incomplete issues a custom listener can I am trying to get comfortable with ScriptRunner and therefore I want to automate a Script that changes the Summary of issues of an certain issuetype everytime the issue is created or updated. hello @Mark Markov. get the issue key by using issue. {it. 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 parameter) works fine in isolation but I can’t get it “connected” to the issue/project in the field. Hello everyone, First of all, thank you a lot for taking several minutes to read/answer this. A quick expansion on this as I understand the request a bit more (I'm unsure how to combine multiple fields/checks together, but below is what I'm seeing looking at the Groovy Script Help information) I want to get an issue's 'request. Hi, I'm trying to post a simple REST API call (hard-coded issue creation) to a test instance via Script Runner. (issue. ; Enter a Name to identify the Macro, like Jira Issue Information. ScriptRunner for Jira can read and write any system or custom field. core. FieldBehaviours import groovy. October 8, 2021 . Hello, in my project I use 2 different issue types. Thank you very much. Product Q&A Groups Learning Events . Have you tried using this query: status != Done AND issueFunction IN linkedIssuesOf("key = ABC-1", "is blocked by") In your Solved: Hi, I am using ScriptRunner to send an email when an issue is created. GenericValue issue) Get a list ScriptRunner will unbundle the events, and call all relevant script listeners for each event. Contributor. July 18, 2018 . Hi Atlassian Community, im looking for solution to set Issue security Level based on custom field value. runner. But how should the condition be, if Write a proper postfunction if you want to implement it for every issue on creation or take the easier route below: Fire a custom event on creation e. I found the info for issues (HERE) but not assets. getFieldById("issuelinks-issues") will always return an array, even an empty one. getFieldById("issuelinks-issues"). Project and I need to get the project key of the current project. g issue_created_set_reporter and . We can go to next step. 11 either manually or via the ScriptRunner setup. But ask here is also display the new clone issue key. The values (including fix version) are added by ScriptRunner scripts. This guide explains how you can extract the stored properties from an issue using ScriptRunner. getIssueService() def actionId = 21 // change this to the step that you want the issues to be transitioned to def transitionValidationResult def transitionResult def customFieldManager = ComponentAccessor. Hi Alexy, I can confirm that what Kate has said is correct and that the Get Issue API which you are calling does support using the fields queryString Parameter and this is documented inside of Atlassian Documentation for this API here. But I am not able to get the current issue object. Your script will be compiled and executed using the issue, so you can see how the field will appear on that particular issue. Set<String> getAllIssueKeys (Long issueId) Returns all issue keys that are associated with Issue. I am new to groovy and have been trying to Dear all, I am using Script runner under Jira Cloud on which I need to convert Script Runner Script from our server side . However, as it’s a composite field consisting of two fields you must set the value differently from other fields. 1 The logs show no issues and displays the values that I expect but the parent stays in the. Example scripts will soon be moving to the ScriptRunner website. The script gets executed correctly, but now we'd like to pass the ProjectKey and ProjectName as Parameter in the script. key + " old reqver " + SourceReqValue) def changeHolder = new DefaultIssueChangeHolder(); Solved: Hello, I try to bulk update the description and a custom field of a list of issues that I find with a JQL search. Unfortunately I'm stuck with a HTTP 400 response althought the call is successful using That appears to be working for me, Thanos. From the Mock 4 issue, the total Story Points used is 15, as shown below:-4. renderSmartValues('{{project. GenericValue issue) Get a list of entities (versions, components etc ScriptRunner for Jira Data Center/Server is an app available on the Atlassian Marketplace that allows you to extend Jira functionality through the use of built-in and custom groovy scripts. Field Summary. getCustomFieldManager() Write a proper postfunction if you want to implement it for every issue on creation or take the easier route below: Fire a custom event on creation e. 0/issues/picker) gives a strange results :( When I type query=PRJ-11 on my JIRA, I have 2 mattching issues - 115 & 116, but I have more than 250 issues and I should have at least 11 matchng issues (11, 110-119). Other operations. I wish to list all the child issues of a specific Epic with Scriptrunner cloud and Jira API v2. def issue = event. getProjectManager() ; def log = Logger. The idea is that I have a premade text file with "#issueKey" in the text file, and I want to replace #issueKey with the actual issue key of the selected issue. A quick expansion on this as I understand the request a bit more (I'm unsure how to combine multiple fields/checks together, but below is what I'm seeing looking at the Groovy Script Help information) ScriptRunner for Jira Data Center. ") Try to break down the task. setCustomFieldValue(cf, 'Cloned Issue Epic Name' + sourceIssue. setCustomFieldValue(epicLinkCustomField) is not working. Alexey Matveev. You could also use issuefunction in porfolioChildrenOf("key = PROG-1") or some other sub-query You can do "issue in childIssuesOf()", but that only takes a single issue key as a parameter, not a saved filter (or any other JQL). Frédérique Cusson August 27, 2020 . key + ': ' + sourceIssue. Share. This method will strictly only return the issue which has current issue key equal to the one given. Mahdi Challouf. key == user}. The call should actually happen in a Script Listener but for debugging I'm using the Script Console. 0 Jira Server 8. g Release 1, Release 2, Release 3 etc. It's also possible to get the display result from a specific view by mentioning this view in the getDisplayResult method. FieldBehaviours import In a ScriptRunner script postfunction you don’t need to fetch the issue object of the current issue. In regards to your question with the issue links and potentially having more than one, we're actually creating the issues from JIRA issues, using an issue collector which sets an individual link in the background so, in theory, we shouldn't ever get one with multiple links. As a reminder, a Connect field can have different display views, as explained here: Display view configuration The following example shows how to get the display result of the Dashboard Gadget view You simply need to add the macro code into the template content. getWorklogManager() //get worklogs for issue def logsForIssue = Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers; Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand; OverflowAI GenAI features for Teams; OverflowAPI Train & fine-tune LLMs; Labs The future of collective knowledge sharing; About the company ScriptRunner for Jira Cloud allows you to extend the functionality of Jira Cloud, executing scripts to interact with Jira as W orkflow Extensions or S cript Listeners. List<org. Enter an AQL (IQL) expression to get all Jira fields using AQL. For the Mock 3 issue, the total Story Points used is 12, as shown below:-3. info("Total ${count} issue") However, in your code, it looks like just get the reporter field off the issues so you could try returning just this field off of the issues. managers. thanks for your suggestion. fields. In part 3 we resume our quest for achieving custom user interface (UI) goodness using ScriptRunner and get deeper into the nitty-gritty of manipulating custom fields in Jira. getJiraAuthenticationContext(). I need to get the issue id of the parent issue, so I use issuefunction 'parentsOf()'. issue as Issue // Get a pointer to the current logged in user def CurrentUser = ComponentAccessor. The value is displayed correctly and I can search for values in the field with. Line 12: The resulting list can be transformed into pairs of project key and the number of issues with that project key. name == 'TheIssueType'. Ask a question def issueproject = issue. getByKey('ABC-1') issue. key == "TheKey" && issue. For example, "-1" if it's the first time a fragment has been // This is how we log information in Scriptrunner: // log. ("Now adding version " + version + " to issue " + issue. worklog. DefaultIssueManager import com. g. issue as Issue def workLogManager = ComponentAccessor. customFieldManager. ofbiz. key} complete URL is the final URL which the end-user can click in the mail and land on the issue. I find the best way to do this by using ScriptRunner workflow function: Set issue security level depending on provided conditionHelp Sets issue security if the provided condition evaluates to Link Issues with ScriptRunner . Note: Ideally issue picker would just support something like {issue. Under Issue actions, select Comment on issue. To see which keyword you can use, click on the question mark symbol as shown in the image below:- Enter a Preview Issue Key and click Preview to view the drop-down. I am having a problem get the asset key from the event and have been unable to find exactly how to do that. issueKey: The issue key for the issue where the script is being executed. With this feature, we will be able to do check on the status or other standard fields value. Select an issue, or issues, in the drop-down, to view how the result will be displayed when viewing an issue, and in the Issue Navigator (column view). The returnSprintWorkloadReport() method works by looping over each issue returned from the search and displaying a message in the logs tag of who the issue is assigned to and its current status. Let say I want to, among other things create an issue for each project using a schedule trigger. codehaus. 7. Select New action. For your requirement, you must create a Server-Side Behaviour for the Reporter field. Therefore if you want to get the value of the custom field with key customfield_13206 you will need something like . View More Comments You must be a registered user to add a comment. getCustomFieldValue(customField), newValue), new Hi @Humberto Gomes. The easiest way to get the content code is to insert a Jira macro into a test page and then look at the source format. atlassian. Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type. issueType?. summary. Solution. ScriptRunner Groovy script - Tested on script console How to get the current user using ScriptRunner Jira cloud and update a field using /rest/api/2/issue Rajeev Joshi June 27, 2022 edited I am trying to update a field based on the current user using Script Runner Jira cloud as a post function of a workflow transition. def issueManager = ComponentAccessor. Calling this API will return the JSON for all fields on the issue and one of the fields inside of the JSON will be the Priority field and you will see in the JSON the structure Solved: ScriptRunner 6. getProjectObject(). Returns an issue that has been moved by searching on the old issue key. The simple thing to do here is run the JQL and work with the results. onresolve. So you can update an issue like this anywhere you have a com. getIssueManager(); // Get the issue you're interested in by issue key: ScriptRunner for Jira Data Center/Server is an app available on the Atlassian Marketplace that allows you to extend Jira functionality through the use of built-in and custom groovy scripts. This is what I have, I mean part of the code . getissue to get every issue on creation instead of getting the issue by key. In my Behaviour script I get the name of an Issue (provided by a custom field). key}\">${issue. id) I'm not sure which version of ScriptRunner that you are using, but in more recent versions of ScriptRunner the "Linked Returns an issue that has been moved by searching on the old issue key. Create the macro. Reading the Linked Issues field value. getCustomFieldValue(incidentAssetCf) //get provider, the attribute insight of selected asset def getProvider = issue. NET Runtime 8. Problem still persists for me but I have a workaround (I shared it in the initial Hi I have created a custom listener script below ( and this is my first time doing that ) that assigns the issue ( created / edited ) to certain user based on certain custom field value but I got an issue : 1- I need the script to run on the current issue instead of While using the Automation for Jira Cloud, is it possible to get the key of the issue that was created in the very same automation? Here's a screenshot of what I'm trying to implement. type' property to judge which way created issue with jira api, I know the jira rest api can help me do it, and I tried use following way to do it in scriptrunner and I tried use following way to do it in scriptrunner. These scripts can be scheduled as a job or to be run on an issue transition within Jira workflows or etc. Get the epic (e. * import com. 4. Answer accepted. Global context not associated with any project or any issues types. warn("the key project selected is" + value) but I get errors, java. You may want to use our UI Fragments built-in scripts to: the key for the duplicated fragment is suffixed with the first available number. Select Save. After creating the field ensure it has the correct context and the Hello everyone, I would like to know how I can retrieve an issue on Jira from his ID, knowing that with this code I have the following error: No signature of method: org. Hi! I want to create a script field in jira cloud called PX: Total Project Cost with scriptrunner. ScriptRunner JQL Query to Find Linked Issues of "is blocked by" AND Linked Issues' Status != Done I could get ALL issues' blockers but couldn't get ONLY blockers for ONLY 1 specific issue. Like # people like this . Any JQL you place there needs to be able to work exactly as is in a regular issue navigator screen. // Get the Project Manager def projectManager = ComponentAccessor. We can then see how many issues are unassigned in the sprint and how many issues have been assigned to each user. . Issue object. GroovyScriptEngineImpl. I can use this script to quickly edit the epic link instead of spending time doing this manually. create(projectKey , 'Bug') { setSummary('My Issue Sum * Right now we are able to use ScriptRunner Listener -> Clone Issue, Link functionality to create sub-task which is clone of given issue. NullPointerException: Cannot get property 'key' on null object . getCustomFieldObject(10706) def incidentAssetValue = issue. ComponentAccessor import com. bourguignon. I want to execute a script whenever a new project is created. ComponentAccessor import Hello, I am creating a global Jira Automation rule in script runner. Alexey Paveliev. ScriptRunnerImpl") ; def projs_key = ['PROJECT1'] ; // This will be the list of all the projects, testing script for 1 project now . def Hi @David Semmens ~ maybe I'm not fully understanding why issue in (childIssuesOf(PROG-1)) OR key = PROG-1 won't work. Below is a working sample code for your reference:-import com. GenericValue issue) Get a list of entities (versions, components etc Wanting to get the old issue key after movement in a field. I've imported com. Hi, I am using JIRA version 7. If you issuelinks as the identifier it will make both the direction and the issues readonly, required, etc, eg: Scriptrunner is never going to have an entire JQL engine written into it to replicate what a JQL search already does. Docs Home; The Adaptavist Group; Kolekti; ScriptRunner; Upscale; Docs Home The Adaptavist Group Kolekti ScriptRunner Upscale. I mentioned this to Jamie and he may fix it. ComponentAccessor. Out @Gezim Shehu [Communardo] , first of all thank you for your reponse , but ecxcuse i make my userByKey and project key , but always results = 0 for all issues and in progress. Ask a question " + issue. As a reminder, a Connect field can have different display views, as explained here: Display view configuration The following example shows how to get the display result of the Dashboard Gadget view #### Overview Use this snippet to search for issues using JQL. lang. How do I get the linked issue ? Answer. Is it possible? Muhammad Jahanzaib Tariq_ T-6074 February 21, 2022 . I can confirm in ScriptRunner for Jira Cloud that you can call the Issue API which is documented in the Atlassian documentation page located here with a Get request. entity. The template Next, get the key of an existing issue and enter it in the "Preview " box, and press Go. This 'Prior Release Name' works fine and displays the prior values, e. getComponent(JsonEntityPropertyManager. project?. The issue variable can potentially be null if we cannot get the issue from the context, The issue was that I only had the field itself, but not the value of the field on the issue itself. ; Select Create Custom Macro. Enter the following comment: I'm using Scriptrunner for Jira Cloud. key) IssueService issueService = ComponentAccessor. We're running Jira DC 9. Create . I have tested the code Kate has provided and can confirm if you include this in your API call that it will return just the fields that Hi all, In the groovy script (I’m writing exalate script), how can I get the issue linked with an issue in a specific link name, just like when we are using the JQL function: issue in linkedIssues("ITC-10", "causes") In the picture below, I want to get the issue ITC-2. If you are using the new version of ScriptRunner just type issue followed by dot and then press Ctrl + space key. def issue = Issues. Out of the box it allows you to use Groovy s Retrieves the Issue that has the given key, or null if no such Issue exists. To transition an issue, run the following script from the script console: In this example we're starting progress on an issue. For each, we find out the linked issue (whether that be an inward or outward link), and update the Epic Link custom field with the key of the Epic. I want to get a user's display name (full name). issue def myIssueKey = myIssue. Do you know how to do the same thing with ScriptRunner scripted field // Get default issue in script console final Issue issue = getIssueOrDefault('MN0001-1') log. Thanks, Scott! REST API browser is a cool tool! :) Unfortunately this operation (api/1. I need to update attributes when certain other attributes are updated. as issue variable from listener) Get the issues in You can create a macro to pull Jira issue information onto your Confluence page. I'm not finding how to get the parent of import com. So, I'm somewhat new to ScriptRunner. I hope this helps. For some reason the method getModifiedF So if you are not in an issue create screen, you can get the issue using the . getIssueObject(event. I'm finding a lot of articles for how to get the username from the full name, but I want to do the opposite because I want to d HAPI is an API (application programming interface) for doing common tasks in Jira, including managing issues, searching for issues, updating fields and much more! HAPI is a simple alternative to Jira's regular API and can be used in your Groovy scripts. user. Display custom, readily-calculated data (time, currency, percentages) across I am using a Script Runner custom 'Issue Picker' field to display the JQL results the 'Prior Release Names' field. Once this new issue is cloned and created, I would three subtasks to be ScriptRunner for Jira - Get all issue type schemes and issue types; ScriptRunner for Jira - Get all project permissions; ScriptRunner for Jira - Get fields on a screen; ScriptRunner for Jira - Get list of projects, issue types, components, lead, version and category; ScriptRunner for Jira - Get projects from issue types; ScriptRunner for Jira * Right now we are able to use ScriptRunner Listener -> Clone Issue, Link functionality to create sub-task which is clone of given issue. I'm currently trying to write an initializer that would hide/show certain fields on the issue edit screen based on the current status in the workflow. The issues of both types can have the same assignee. it seems the issue. However when I pick the value, e. common //get asset incident def incidentAssetCf = ComponentAccessor. Learn @brbojorque , @Neta Elyakim Do you guys know how i can get the script to populate custom field from the Jira issue it is creating the page from? Right now it seems i can only get issue. 2. issue. LinkedIn; Twitter; Email; Copy Link; 29976 views. For example, global custom fields have an IssueContext whose project and issue type are null. Catch the event in the listener and use event. While creating a new issue using scriptrunner, I would like to assign it an existing epic. eloykhedfrwybxdwsltttqixgljqqflauwirmgzbyxlkcnlylhoyv