Comments
-
In a postfunction for your workflow transition where the main story is being marked as done, you can add a sriptrunner post function using "custom script post function" with a script somewhat like this: import com.atlassian.jira.component.ComponentAccessor def issueLinkManager = ComponentAccessor.issueLinkManager def…
-
Some screenshots may be helpful... like this: Custom Fields page: Script FIeld page: How is what you are seeing different from what I'm showing? On the second screenshot, you would click the action config wheel and choose edit to go enter the script. Usually, I skip the first screen and create my new scripted field…
-
Your task must be using the same workflow as the epic. So that the epic creation triggered the creation of a task, which triggered the creation of a task which... So in your Condition, put originalIssue.issueType.name == 'Epic' Target Issue Type: select Task In additional issue actions, you have to link your tasks to the…
-
Static type checking errors don't usually mean that the code is bad. If you want to remove those, you have to define every object with the appropriate type. I'm not sure why updateIssue is not visible in the autocomplete, but it's definitely a valid…
-
The web section is just a placeholder for the web items to go into. So set your section to always be visible. It should only display when you have a visible web items in it. And the web item has the issue as an available binding.
-
No other ideas. Like I said I haven't worked with Cloud much and I'm not clear on the email handler situation there. All I'd say is to look carefully at the documentation page:…
-
You are missing a line to actually change the value on the issue. linkedIssueObj.setCustomFieldValue(accountField, issue.getCustomFieldValue(accountField) ) But note that this will not cause your linkedIssue to show the history of that change. You will need to add that yourself if you care. Alternatively, use…
-
This can be done using a very simple script using the Simple scripted condition. currentUser and isUserMemeberOfRole are already available within the binding. if( issue.status.name.toLowerCase() == 'hold'){ isUserMemberOfRole('Project Manager') || isUserMemberOfRole('Administrators') } else if(…
-
Using behavior is probably the simplest here. Add the following server side script on your "Link your issue" field: def linkedIssuesFld = getFieldById("issuelinks-issues") def linkInputFld = getFieldById(getFieldChanged()) def inputIssue = linkInputFld.value if(inputIssue){ linkedIssueFld.setFormValue(inputIssue) }
-
I don't think scriptrunner behavior setFieldOptions() method can run on the assignee (or any user fields) to limit the available list. At best, you can react to change in the assignee field and validate the value with the behavior and use the setError() method to stop users from saving while an invalid user is selected.…
-
Most "manager" classes in Jira are accessed using the ComponentAccessor class import com.atlassian.jira.component.ComponentAccessor def commentManager = ComponentAcessor.getCommentManager() //or this works too def commentManager = ComponentAcessor.commentManager Then, your create methods should work, just make sure you…
-
Speaking about server here... but I think the same is true for cloud. The default mail handlers have mail threading handling capability. But that is based on the "message-id" header. If you can somehow cause the external service to generate and re-use a single message-id header for a given alert, then each new email will…
-
Glad you got it working. Couple things I'd like to point out ... 1) I've never had to @grab the http-builder 2) map object keys don't HAVE to be quoted ... only if they include some special characters or you want to use variables. You could also build it this way def rrsetsMap = [:] //initialize an empty map rrsetsMap…
-
Sorry, I don't work with Service desk ... so I don't know if Scriptrunner web fragments can interact here.
-
Can you include screenshots of your service configuration screens? Hover over the edit link... and grab the id in the url Then check the scheduler details screen. Switch to Jobs tab and search for the id. Then check if it's even registered. What the last run duration is and click show more to view the details and include…
-
This short example limits the list of components in the issue screen to only the components that are less than 5 characters in length: import com.atlassian.jira.component.ComponentAccessor def allComponents = ComponentAccessor.projectComponentManager.findAllForProject(issueContext.projectId) def componentField =…
-
I'm not sure if mean the customer-facing service-desk screens... But if you want to add a link to service desk from the main Jira header, that's exactly what the first example here shows. But instead of search the web ... link to your support service desk.
-
Well, Scriptrunner can interact with other plugins native Java methods. See https://scriptrunner.adaptavist.com/latest/jira/scripting-other-plugins.html But you are kind of on your own (unless you can get support or documentation from the Git Integration for Jira guys) to figure out what those APIs are. But it might be…
-
I know, I just wanted to provide the example of creating the fileEntity using the multipartEntyBuilder btw, here is the full class path: import org.apache.http.entity.mime.MultipartEntityBuilder Looking that up a little, I see that you can do the following: import org.apache.http.entity.mime.MultipartEntityBuilder import…
-
Can you show the resulting code? I made a typo on the second header line... it should be headers.nameOfYourHeader = "value for header" If the name of your header contains "-" then put the name in quotes.
-
Put your code in both the impact and probability fields. The risk score sever-side script only runs when risk score is modified. To change the risk score when the impact is modified, put the code in the impact server-side script ... and to change it when the probability field changes, put the code on that fields's server…
-
I'm not sure I get your question. Are you happy with the look of the fields in the edit screen? Is it only the display screen layout of the resulting data that you want to adjust? If so, I think some post processing using cust java script may be your only route. Or else re-think you approach. A single field with 63…
-
That kinda depends on where your code merge is taking place. Jira/scriptrunner doesn't directly keep track of your code, so it won't have any classes to inspect that status. Depending on the type of VCS you are using, you may need to either connect via REST API to that VCS or perhaps using command line script. But…
-
I've never user Unirest ... or jira-cloud ... but had some issues like that with an actual file and I ended up with something like this using httpBuilder: def file = new File(filePath) def fileEntity = new MultipartEntityBuilder() fileEntity.addBinaryBody("file", file) def httpBuilder = new HTTPBuilder(baseUrl)…
-
Have you tried this right within the context of the issue? I think the ghx-label-1 class has to exist in the css available at any given context. Jira loads css and js resources dynamically based on what it determines is needed based on what will be viewed in the current context. So if you ran that script just in the…
-
It depends on the specifics of what you want to do. There are many ways to branch the logic of a groovy script. For example: if (issue.components.any(it.name == "my test value"){ //do something here } else { //do something else here } This may get complicated if you have multiple components. What will you do if 2…
-
I think the issue is that at the time that the initializer runs, the form field for the description has not yet been populated by jira (which seems to keep it in memory and re-apply it to the field after the fields are rendered). Put your code against the Issue Type field instead of the initializer, it will refresh each…
-
At first, I was going to say you can't do that ... but with a bit of perseverance ... I think I found something that might work for you: Try this: import com.atlassian.jira.component.ComponentAccessor; import com.atlassian.jira.issue.CustomFieldManager; import com.atlassian.jira.issue.fields.CustomField; import…
-
Might be in how you prepare your request. So I saw two possible mistakes compared to how I use the HTTPBuilder * I don't think that "request" can be used inside the request closure * There is already a headers map object that you can just add values to. * The body object will accept a pure hashmap object and will…
-
issue.components or issue.getComponents() will give you an array of all the components. That array could be empty, with only 1 or many values. There you can test for null, or size... or collect the list of names: "$issue.key has the following components: ${issue.components*.name}"