Comments
-
Hi Melanie Welcome to the community :) There are dozens of such examples in the community, but here is how I would do it. def formFieldA = getFieldByName('fieldA') def formFieldB = getFieldByName('fieldB') def map = [ 'A':['Monday', 'Wednesday'], 'AB':['Monday', 'Tuesday'] ] def cfFieldB =…
-
I can't see how I might have qualified as I don't think I answered a single cloud question. I'm pretty strictly a server kinda guy. I'd be happy to let someone more deserving get my cloudie... But if all my server/dc based scriptrunner answers qualify, I'll take it. :) Happy Friday!
-
I'm not clear on why \\ works in jira. But I'm pretty sure that there is some escaping going on such that \n is interpreted as \\n etc. I find that in my testing if you do something like this, it works in both JIRA and JSD:
-
You may have to include some styles of your own.
-
Okay, a few questions ... 1) Do you have any code in the initializer server-side script? 2) Do you have any code in the server-side script for CM Deployment Type? My guess is that when the fields are initially populated from the DB when the edit screen is opening, one of your scripts is firing and causing the deployment…
-
I think it's because there is no "page" object in that context. When I create a panel in that same context writer.write("""<div style="padding: 5px 5px 5px 0;">Test Panel: ${context.keySet()}</div>""") I see just "Dashboard Test Panel: [action]" So the only object inside the atl.page.metadata.banner is the "action" object…
-
Hi @Theresa Reynolds I will be in the same migration boat for Server to DC and my understanding is that most scriptrunner standard script implementations will be identical between the two environments. Most jira admin would agree with the philosophy of avoiding setting other users as watchers. Invariably, someone will come…
-
Hi Let me see if I can repeat your challenge... When editing, you want to be able to change the CM Class field and when it triggers the current value for CM Deploy to no longer be valid, this current value should still be visible in the field. Questions: Should the user be able to save the issue with the new CM Class while…
-
You can use the AUI design patterns already included in JIRA https://aui.atlassian.com/aui/9.2.0/docs/forms.html For example, in your dialog html, include a form like this <form class="aui top-label"> <fieldset class="group"> <label for="textfieldid">Label for your field</label> <input type="text" class="aui text"…
-
You can’t use the annotations there. You have to build your own html form using plain html. But for the form to do anything, you will have to include javascript to tell it what to do. You may need to created some rest endpoint for your javascript to point to.
-
Here taking your original script and adding my suggestions: import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.security.IssueSecurityLevelManager import com.atlassian.jira.issue.security.IssueSecuritySchemeManager import…
-
Hi This is a big question. It's not very different than asking: I want to create a mobile app that will make lots of money. How can I do that? This requires a fair amount of prior programming experience. You can read this to get you…
-
Hi For starters, you can remove the static type checking errors (which are not always show- stopper, but in the case they are) by using com.atlassian.jira.issue.MutableIssue instead of com.atlassian.jira.issue.Issue and removing the single quotes around your security level Id. But then, this only modifies an instance of an…
-
This is old and came across it while searching for something else. I haven't reviewed the code carefully I see 2 options to achieve forcing the status to Open for all Move operations 1) Scripted Listener like you proposed. But this requires that all of your possible target workflows must allow transition from ANY status to…
-
Try def newProductVersions = productVersionValue.collect{Version version-> versionManager.getVersion(linkedIssue.projectObject.id, version.name) } or def newProductVersions = productVersionValue.collect{version-> versionManager.getVersion(linkedIssue.projectObject.id, version.name as String) }
-
I mean that even if they look the same, in the db they are 2 separate things each with unique IDs. So you'll need to find the match. Something like this inside the linkedIssues.each{} def versionManager = ComponentAccessor.versionManager linkedIssues.each { def linkedIssue = it.sourceObject as MutableIssue def…
-
I'm not going to ask why you are doing this or why you tagged your post with scriptrunner or adaptavist ... but let's see what we can find out is going on with this script. The first thing that seems odd to me is this: var actions = AJS.$(row).find('td.issue_actions'); "row" is not defined anywhere. And in modern versions…
-
Ok, looking at this: 2021-01-19 14:23:24,580 INFO [runner.ScriptBindingsManager]: Attempting to set the affectedversion field on XXXX-177104 to [5.3.1] which is an object of type class java.util.ArrayList It appears that productVersionValue is already an array. So we don't want to put it inside another array. So using this…
-
You are attempting to update the wrong issue I think linkedIssue.setAffectedVersions([productVersionValue]) [...] issueManager.updateIssue(currentUser,issue,EventDispatchOption.ISSUE_UPDATED,false) You set the value of "linkedIssue", but then store the "issue" object. Also, keep in mind that you will need to manually index…
-
Hi @Lacey Also First, in order to have issueType behaviour be reset when you change projects, you behaviour project mapping needs to be set to "All Projects" and "All Issue Types". Otherwise, the script only fires in the mapped project, and doesn't reset when you change the project unless you close and re-open the form.…
-
A few things to try 1) add import com.atlassian.jira.project.version.Version 2) add "as Version" when getting the productVersionValue def productVersionValue = issue.getCustomFieldValue(productVersionCf) as Version 3) add "as MutableIssue when setting the linkedIssue: def linkedIssue = it.destinationObject as MutableIssue…
-
What type of customfield is your Product Version customer field (11622)? Is that text, Version Picker Single or Version Picker Multiple? That will make a difference for how to apply the value to the built-in version field.
-
Ah the full context and screenshot really helps. As you can see in the error, you are giving the setAffectdVersions a list of "CustomField" object. When you see to provide a Version object Looking at the line where the ProductVersion is defined: def productVersion = customFieldManager.getCustomFieldObject(11622) //Product…
-
Try: destinationIssue.setAffectedVersions([productVersion]) Since Affect/s Version allows more than 1 value, you must specify a Collection
-
You could try it like this: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.web.bean.PagerFilter import com.atlassian.jira.user.ApplicationUser import com.atlassian.jira.issue.Issue import com.atlassian.jira.bc.issue.search.SearchService //managers def searchService =…
-
You could try something like the following that should work whether the custom field is a single or multi-user picker. If it's a multi, a subtask will be created for each user selected in the custom field. import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.web.bean.PagerFilter import…
-
You mention PostFunction. This is normally something that happens on a single issue. I don't understand what role your query results play in your script. Can you elaborate on your goal a bit more? Are we creating subtasks on the issue that triggered the postfunction? Or on all issues returned by the JQL?
-
Put the option outside of the logic in a data structure of some kind. Depending on the nature of the permutations of which fields are visible for which option and what your default state should be, you can try something like (assumes fields are hidden unless specified and all visible fields are required) def…
-
Base on the error, my guess is that your custom field is either Checkbox or Multi-Select. This means that result of getCustomFieldValue is an AarrayList<LazyLoadedOption> rather than a single LazyLoadedOption What you can try instead is something like this: def sapTypeCfValues = parentIssue.getCustomFieldValue(sapTypeCF)…
-
This is an inconsequential warning. You can safely ignore it. If it really bothers you, you can force the data type of your calculation with something like this: def days= Math.round((durationMillis / 1000 / 60 / 60/ 24) as Double)