Comments
-
I have not found a way to access the Insight custom field configuration. I tried. I think the only remaining option is to use a sql query to do that. Something like this if you have a jira_local resource defined in your Scriptrunner Resource tab import com.atlassian.jira.component.ComponentAccessor import…
-
That might be a limitation of the HttpBuilder class. Having a body in a delete method goes against the REST specifications. You could look for other libraries that might allow that. But why don't you just use the java api? import com.atlassian.jira.component.ComponentAccessor def classLoader =…
-
I don't think you can use JQL to filter projects in a behaviour/create screen. Instead, filter your projects using Java api: def enabledCategories = ['list','of', 'categories'] if(issueContext.projectObject.projectCategory?.name in enabledCategories){ //the rest of your behaviour script here }
-
I would recommend you look in the third-party app documentation to see how they expect the data to be submitted. Or at least link to the marketplace entry in your question so we can help you find out the necessary documentation exists. Finally, you might be able to contact the third-party support line for some details.
-
I don't think you can do that with ALM Structure (if that's what you meant). But you might be able to do it with a random WebPanel. Not sure where the best place to display that panel might be, however. And I made an assumption that your custom field actually contains data (on a single line) like: "[~tom] 2, [~peter] 4,…
-
This is working for me: import com.onresolve.scriptrunner.parameters.annotation.ShortTextInput import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.security.Permissions @ShortTextInput(description = 'Select admin group to search for', label = 'Admin group') String adminGroup def group =…
-
Without knowing actually what happens in your environment (errors in the log or anything), this is a bit of a shot in the dark... but try like this: data.each{row-> def user = ComponentAccessor.userManager.getUserByName(row.user) if(user){ def props = userPropertyManager.getPropertyeSetForUserKey(user.key)…
-
I don't think there is anything available in a groovy script that will give you this information. I looked. Here is a script where I tried every trick I could find to look for clues: log.info "This.class: ${this.getClass()}" log.info "Properties in this:\n${this.properties.collect{"$it.key = $it.value…
-
Sorry Vikrant, I have no experience with the scriptrunner mail handler.
-
Insight Custom fields in Jira only store a reference to the Insight Object (just the Object Key). So any information displayed in the Jira issue is always a "live" view of the data in the insight object. If you want to know all the attributes of the object at the time the Jira issue was linked to that object, you need to…
-
I just tried this scenario and it works. You might want to consult your <jira-home>/log/insight_automation.log file and see if there are any errors or clues as to what might be going on.
-
Yes, that's possible with scriptrunner. Here is a short script I've prepared. import com.atlassian.jira.bc.JiraServiceContextImpl import com.atlassian.jira.bc.filter.SearchRequestService import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.sharing.SharePermissionImpl import…
-
Insight comes pre-built with its own REST API endpoints. You could just use the IQL Search endpoint <jiraBaseUrl>/rest/insight/latest/iql/objects?iql= But if you don't have the ability in the tempo to perform any transformation on the resulting data, then you can use the scriptrunner rest endpoint feature and the Insight…
-
For something like this (not that this is best practice), I would use a public library like "arrive" Then you can respond to the "arrival" of an object on screen with a line of code like: AJS.$(document).arrive('#rlabs-attach-file .description', function(){ this.innerHTML = "Your custom description"; this.borderStyle =…
-
Can you explain your setup a little bit more? What kind of custom fields are Project Name and WorkId? You indicated that you get some details via REST API. Can you explain how you are currently doing that? Share your existing code.
-
You should be able to access to URL with jiraHelper.request.requestURI
-
Try to add some logging to your script so you can see where things are breaking. import com.atlassian.jira.component.ComponentAccessor; import com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade import com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectTypeAttributeFacade def…
-
First off, did you know that you can suppress events altogether? Instead of objectTypeAttributeBean = objectFacade.storeObjectAttributeBean(objAttBean) //or objectAttributeBean = objectFacade.deleteObjectAttributeBean(objAttBean.id) You can do import static…
-
Glad I was able to help. Please be sure to mark the response as accepted. As for learning scripting, having some coding background helps. Adaptavist (the maker of scriptrunner) offer this on their site. Beyond that, I think there is no better learning than by doing. You have to experiment and fail and try again until you…
-
Try like this: import com.atlassian.jira.component.ComponentAccessor import com.onresolve.jira.groovy.user.FieldBehaviours import com.riadalabs.jira.plugins.insight.services.model.ObjectAttributeBean import com.riadalabs.jira.plugins.insight.services.model.ObjectAttributeValueBean import groovy.transform.BaseScript import…
-
Are you talking about "Group" attribute type in Insight? Or group picker custom field in Jira? Here is a version of the script that will look into a group attribute (named Approval Group) and retrieve all the active users from the selected group(s). import com.atlassian.jira.component.ComponentAccessor import…
-
On the Map-based script, this should already be happening with this line: if(!approvers) approvers = defaultApprovers When the the "approvers" variable is "falsy" (this means it is empty, null, false or zero) then we set it to the defaultApprovers value. So that in the following line:…
-
I recommend you try to understand what each of the two scripts does differently and figure out how to change one into the other. Remember, if you deploy this, someone may have to maintain it in the future. But if you attempt the exercise yourself and want to check youself, here is a version of the first script with…
-
Ah yes, I often tend to forget the following little fact: formField.getValue() on an Insight object custom field will return either a string or an arrayList depending on whether this is the first value or one of many. The way I test something like this is I add the following script to a field I want to examine: def fld =…
-
I'm on an older version of scriptrunner. I'll try to upgrade and see if I can get similar issues as you do and find a fix. However, there might be a difference in our version of Jira as well. I only have access to 8.13.x at the moment.
-
Can you show me the behavior configuration for the Operating System field? Are you sure there is not more than one other behaviour mapping that includes a configuration for Operating System? Also I'm noticing that the Operating System appears to allow multiple values. What should happen if the user selected both "Windows…
-
Adaptavist is targetting "feature parity" between the two classes of products. But as you know each "feature" might be achieved in dramatically different ways. So yes, you will need to * Find all the scripts * Identify the goal of each script * Determine if the goal can be achieved in the cloud and or if it still provides…
-
I'm not sure what issue you are talking about. I've already provided a solution for how to correctly fill-in the Approvers field with the correct spacing. Can you describe what issue remains?
-
If you want to add more hardcoded users for different OS, you can just add them to the map: def systemApproversMap = [ 'Windows 10':['wUser1', 'wUser2', 'wUser3'], 'CentOS': ['cUser1', 'cUser2', 'cUser3'] ] You should only need to add the script to the server-side script on the System custom field.
-
That's surprising behavior for me. But I was able to replicate and confirm. You can get around it with (in either script): approversFld.setFormValue(approvers.join(', '))