Comments
-
Yes, of course, that can be accomplished with a scripted field. But that was not the question.
-
You can get a sprint name from a sprint Id using the following elements import com.atlassian.greenhopper.service.sprint.SprintManager import com.onresolve.scriptrunner.runner.customisers.JiraAgileBean import com.onresolve.scriptrunner.runner.customisers.WithPlugin @WithPlugin("com.pyxis.greenhopper.jira") @JiraAgileBean…
-
Yes, in your Login attributes, click the config wheel for the Related Privileges attribute. In filter objects, you can enter an IQL like: "Associated Application" = ${Related Application} If Related Application allows mulitples, the IQL will be "Associated Application" in ${Related Application${0}} or (I am never sure)…
-
Can you temporarily set the identifier in your import to another field that is unique and populated for 100% of the users? Like, maybe the mail attribute? When you sync, the Name should be refreshed back based on your mapping. FYI, the "Identifier" in the import, the way it works is that this is what's used to decide if a…
-
I'll assume all 3 custom fields are "single select" type of fields. One possible solution to automatically fill in a field like this is using scriptrunner behaviour. Create a behaviour with the correct project/issue type mapping. Add both field1 and field2 to the behaviour configuration and add the script below to BOTH…
-
That is best done in a postfunction in the create transition. Simply add a custom scripted postfunction with a single line of code: issue.summary = "Oracle: " + issue.summary
-
I think linking an object to an issue is more of an issue-based event than an Insight object event (the insight object just happens to display the incoming links). If you have Scriptrunner, you can use a custom scripted event and watch for the custom field that links to your object type. Otherwise, you'll have to rely on…
-
I would recommend you find a different way to achieve your requirement. That add-on's documentation and support pages don't appear to be available anymore (dead links). This doesn't bode well for the likelihood of the developer creating new versions if/when a new version of Jira breaks the compatibility. How to set values…
-
Glad I could help. I use Intelij community edition as my IDE. There are some instructions on the adaptavist site on how to configure. When you start with their sample project (even if you have no plans to create a plugin or anything like that) the IDE will download all the relevant dependencies so that you get the full…
-
Hi Kamran I've encountered this. It turns out that every time you click the button, your dialog html is embedded into the DOM and when you close it, the html is still in there. Every time you click the button, you get another copy in the DOM. You can avoid this by adding the data-aui-remove-on-hide attribute to the section…
-
Sorry... I have nothing more to suggest. I'm not convinced these errors are linked to the post function script. I'd try a full locked reindex.
-
If anyone else comes here because you thought the "Code Block" format style had gone away .... clear your browser cache to get it back. // I'm only happy when I'm coding
-
Try to use IssueService instead of IssueManager. It is better at managing the indexing. def validationResult = issueService.validateDelete(currentUser, subTask.id) if(validationResult.isValid()){ issueSevice.delete(currentUser, validationResult, EventDispatchOption.ISSUE_DELETED, false) } Another option might be to…
-
Can you include the first 10 lines of the errors message (or so). That should give us some hints.
-
In the scriptrunner condition for your panel, you can include something like this: !version.description.contains('was sent to SD by') Then, you might want to add something in your javascript to hide the button after success. And while you are at it, you could either force a page refresh to show the updated description or…
-
You can only import valid classes. Use the Atlassian JAVADocs documentation to see what is available: https://docs.atlassian.com/software/jira/docs/api/8.13.6/ But in many cases, the only import you need is the ComponentAccessor (this refers to the jira java component, not the project component) getComponent() is a method…
-
When you retrieve the value from your custom field, don't coerce the type to String: def EinddatumprojectCustomFieldValue = (EinddatumprojectCustomFieldObject ? relatedIssue.getCustomFieldValue(EinddatumprojectCustomFieldObject) : null) as String Because when you do that, you get the default format and you can't change it.…
-
It might be helpful to see the first 5-10 lines of the stack trace. But I know that to get the current user, I use the following: def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser This also works (but groovy lets you omit the get keywords and that's my preference): def user =…
-
I couldn't resist ... forked the project and modified the getObjectAttributeValues() to recognized dotNotation Attribute and recursively call itself. I created a pull request. We'll see if they like it. I'll still keep my own implementation. For one, theirs is mentioning deprecating the ability to elevate privileges and…
-
You might not need any scripting. In your Create transition, add a post function. Select "insight post function" Choose "Assign Objects from an IQL query based on data from an issue" You can leave the condition blank or set it to "true" In IQL, put something like this objectType = Servers and Name=${Name of Jira Field with…
-
For anyone watching this ... I happened to run across this alternative https://github.com/Riada-AB/InsightManager It seems to achieve many of the same features, has a few methods that I've never needed or developed, and proper functional test. It is also cleaner, better documented, and more thought-through than mine. And…
-
There are a couple of ways you can return a value from a closure (everything in the curly brace after http.request(PUT) is a closure) You can assign the whole statement to a variable def myRequestOutput = http.request(PUT){...} Then you can extract the id from that object with def id = myRequestOutput.id That works because…
-
If you have a priority object retrieved from issue.getPriority() and you want to display it a new comment body string, you probably want to grab the name of the priority. def priority = issue.getPriority() def bodyString = "Some comment with prioirity name: ${priority.name}"
-
You have some java script code already that can capture a user's action. Javascript is a powerful development language. Write some java script code that calls the JIRA API described in the link to make the desired change to the version.
-
Before, you were only GUESSING at the actual index by using the last assignee. And looking up the index from the last assignee name always returned the first matching item in the array and ignores subsequent instances of that name.
-
No, I meant a screenshot like this one: The problem with your user array approach is that this line: def lastAssigneeIndex = userNames.indexOf(lastAssignee) When the lastAssignee is "user2", will always return index=1. So round robin witll start with user1, next time, it will find user1 (index=0) and move to the next user…
-
All behaviour functionality relies heavily on client-side javascript functionality. So there are some inherent limitations that this comes with. Including having possible delays before the client-side applies the DOM change associated with the desired behaviour (which first has to be fetched from the server-side script).…
-
Can you share more details about the configuration of you web item? Specifically, what section is configured to go in? The underlying code to bind your custom web item's click and generate a flag instead of just navigating natively to the URL is not available in all contexts. You can get around that by changing the webItem…
-
The way behaviours are implemented, they don't work for inline edits. Normally, when you apply a behaviour for a field, scriptrunner disables the inline edit and any attempt at editing in-line will open up the edit screen. But maybe this automatic disabling of inline edit only works if you have a setReadOnly or…
-
Here is a short function that can return the date based on a number of business days ago import groovy.time.TimeCategory def busDayAgo(startDate, nDays){ def ago=startDate (0..nDays).each{ use(TimeCategory){ ago = ago.minus(1.day) (ago.day in [0,6]) && (ago = ago.minus(1.day)) } } ago } busDayAgo(new Date(),5)