Comments
-
Then try my script in the scriptrunner console instead of the Insight Groovy Console. Just add a line at the top to get an issue: def issue=ComponentAccessor.issueManager.getCustomFieldObject("YOURKEY-123")
-
Do you have the Scriptrunner App?
-
That seems like a good use case for the linkedIssuesOf jql function. Try something like issueType=REQ and issueFunction in linkedIssuesOf("issueType=Epic and timespend>0", "has requirement") Note that you want the reverse of your "is requirement of" link in the second parameter of the function.
-
I replied on your other post too... but here, the main issue I see and I should warn you about is that you are trying to use ScripRunner notation (@WithPlugin and @PluginModule) inside an Insight groovy script. That won't work. If you have scriptrunner, I think you should use custom scripted postfunctions for all your…
-
I don't understand what this has to do with anything in your initial question: def newValue = issue.getCustomFieldValue(jiraCustomField); my = DateFormat.getDateInstance().format(newValue); I thought you were trying to add an ApplicationUser value from a UserPicker custom field to a User insight attribute. Here is a new…
-
You have to first read the attribute values of the object into an array. Then you can add your user to that array and re-apply that array back to the object. It's probably a good idea to run .unique() on the array before adding it back in case the user you want to add is already in the list.
-
I was forgetting the newer syntax for getting a built-in script object: import com.onresolve.scriptrunner.runner.ScriptRunnerImpl import com.onresolve.scriptrunner.canned.jira.admin.CopyProject def copyProject = ScriptRunnerImpl.scriptRunner.createBean(CopyProject)
-
I have several thoughts ... 1) If you are manipulating JSON in groovy, don't try to do it yourself. Use the built-in libraries for that import groovy.json.JsonBuilder def projectPayload = [key: PROJECT_KEY_TO_CREATE, name:PROJECT_NAME_TO_CREATE, lead:PROJECT_LEAD_USERNAME, description:PROJECT_DESCRIPTION] def…
-
Sorry @Jenny Severin I have no experience with cloud.
-
But for some reason, in the created task, the description becomes the one specified in the script I'm confused. Isn't that the reason why you have the script in the first place? If the description is read-only. Check that you don't have another behaviour that's adjusting this property. And if you are able to edit the…
-
Yes, I've had that issue. If a field for which you have a placeholder pointer in the IQL is not on the form, then the IQL crashes and returns no results at all. I think if you explore the logs, you might actually see the error with the IQL. The placeholder returns a null wich ends up generating an invalid IQL.
-
The final result would look something like this: "project = jcd and issuetype = Homepage and comment ~ "rumba" and updated > -1m"
-
Make sure you don't have any field selection in the "Configure Fields" drop-down at the top right of the form. If you are not displaying ALL, then the tabs disappear. Otherwise, for me, the create sub-task displays tab normally.
-
I wonder if you have some leftover attempts to set the description in the Create transition of your workflow. That's what overwriting the user input after submitting. Because what you have there should work and allow you to edit the default before submitting and the user-submitted description should be saved correctly.
-
That often trips me up too... does the "Business Until 3" custom field allow multiple values? Try ("Application Status" = "Active" AND Selectable = True) OR ("Application Status" = "Active" AND BU3 = ${Business Unit 3${0}}) or ("Application Status" = "Active" AND Selectable = True) OR ("Application Status" = "Active" AND…
-
If you run this in your console, import com.atlassian.jira.component.ComponentAccessor def issue = ComponentAccessor.issueManager.getIssueObject('KEY-123') def orgCf = ComponentAccessor.customFieldManager.getCustomFieldObjectsByName('Organizations') issue.getCustomFieldValue(orgCf)*.getClass() You should see this result:…
-
According to developer documentation for webhooks they are executed "without a specific user context". My guess is that the scriptrunner issueFunction (at least the lastComment function) requires this context and fails silently when executed within the webook. You can try to just use "updated > -1m" since commenting on an…
-
"underlyingIssue" is an issue. So you don't need to convert it. The problem is that on a create screen, underlyingIssue doesn't exist. But we can protect against that using the nullsafe operator (?) So this should work: if (underlyingIssue?.status?.name == "Ready" ) { switchTab(1) disableTab(2) } else { disableTab(1)…
-
Funny I was just working on solving a similar problem yesterday. It's easy enough to use the Canned Post Function "clone issue and link", but that would have to be repeated manually for each project etc. So we need a way to call that post function n number of times. One challenge that comes with that, is if you have to…
-
You can not have 2 different behaviours run on the same field. The last one to be evaluated (and you can't control the order) will win. If you have to combine your 2 scripts into 1 that will account for both possibilities.
-
You can try something like this: def projectRoleManager = ComponentAccessor.getComponentOfType(ProjectRoleManager) def allowedRoles = ['Administrators', 'Scrum Masters'] def isUserInAllowedRoles = allowedRoles.any{ projectRole -> def role = projectRoleManager.getProjectRole(projectRole)…
-
This is documented here: https://confluence.atlassian.com/servicemanagementserver/advanced-placeholders-1044784599.html I preferred the documentation when it was on the old mindville site. The new site relies on knowing the right search terms. You can't just browse all the pages and read them systematically.
-
You can try: options.sort{it.value.toLowerCase()}.eachWithIndex{opt, i-> opt.sequence = i }
-
This may not be 100% the best implementation for your use case given how few details you shared, but it is possible to add options to a SingleSelect field using a script. You would use this API: OptionsManager.createOption You could add an event listener that watches for "Sprint Created" and will add the newly created…
-
Correct, that is my understanding as well.
-
Most of this error message is about the httpbuilder not being able to parse this response into a JSON. But the root cause of it is that you didn't receive a valid JSON from your endpoint, probably because you didn't send a valid request. The first line gives you some clues: "412, reason phrase: Precondition Failed" This…
-
I can't see where issueTypeId_Soll is declared and set. And I see you first set issueTypeId_IST to 10202 and then later to the issueTypeId. That might be why your if block is not working as you expect. But let me ask a more fundamental question ... if this is only expected to fire on a single workflow when the status…
-
The + sign on the Issues in Epic section brings up a somewhat regular Create screen. It should be possible in theory to use behaviours to filter the list of issue types (and perhaps even projects). The challenge I had in my testing was detecting a difference between a normal Create action vs a 'Create issue in epic'…
-
I don't think that's possible. At least I can't think of a way to achieve this. There is nothing in script runner that would prevent manipulations from the backlog to drag issues to/front sprints. The best you could do is generate some after-the-fact warning/notifications. Like check for such change taking place and either…
-
Hi This code: changeHistoryManager.getChangeItemsForField(issue, "Group Assignee") will return a List of ChangeItem Beans. That means all the change items for this "Group Assignee".…