Comments
-
Just a heads up about behaviour and insight field. If the field contains a single object, the value will be a string with the object key. If the field contains multiple objects, the value will be a list of strings (each with the object key). This is independent of whether the field allows 1 or multiple. In other words, an…
-
Where did you put this code? It needs to be in the "Affects Versions" config:
-
You would have to call the Comment Property api looking for the property key "sd.public.comment" for each comment and filter them in your client application.
-
Here is a nice blog post about it: https://www.adaptavist.com/blog/trojan-codes-in-atlassian-products-and-scriptrunner The main takeaway for me was that Jira or Confluence are not directly at risk, but they can be used to trick someone else to copy code from jira/confluence into another system and then when that system is…
-
Are the subtasks created by some sort of existing automation? If so, can you share what you have so far? Or are these manual subtasks created by the user via the UI and you only need to automate the date field? If so, do the parent task and the sub-task share the same workflow? Or are they different workflows? You should…
-
If you have scriptrunner, the only option for real-time update option is with Behaviours. If you create a behaviour configuration and map your service desk project and the appropriate request type, you can then add your field A to the behaviour configuration. In the field A behaviour config, click the Add a Server-Side…
-
Your script should output one of 4 values: * Yes * No * No IT Tasks * Don't Know If you doa JQL with "product done by it" ~ no I'd expect all issues where you'd expect 2, 3 or 4 to be returned. I'd look at the actual value returned for issues you know should return a "Yes" and make sure the script works as designed. I'm…
-
Based on that same documentation page, I see that in order to initiate a move, the user must be a MANAGER on the source object type and DEVELOPER on the target object type. Because a MOVE has a similar impact as DELETE on the source and CREATE on the target. And the matrix at the bottom of the page indicates that DELETE is…
-
On the summary field server-side script, add the following: def summaryFld = getFieldById(fieldChanged) def specialMatcher = summaryFld.value =~ /[^\w\s]/ summaryFld.clearError() if(specialMatcher){ summaryFld.setError("Specials characters are not allowed: ${specialMatcher.collect().unique().join(' ')}") } If you want to…
-
I've never actually encountered this situation, but here are my suggestions: First try to just restart jira if you can. If not, you can try to go to the admin page for "Versions & Licenses" and attempt to re-install Service Management. If it's already installed, disable it (be sure to select to keep all configurations) and…
-
Don't mix apples and oranges... and don't try to assign affected versions to project components. That's probably where your problem lies. Also, you would not get into this sort of trouble if you used the soft-typing in groovy. Try this: def affectedVersionFld = getFieldByID(AFFECTED_VERSION) affectedVersionFld.clearError()…
-
Hi Peter Keep in mind that many errors displayed in scriptrunner script editors are warning only. This error is telling you that myFieldValue will be of type "object". That just means that the type was not specified. And the toUpperCase() method is only designed to work on a String. But during runtime, that object might…
-
Hi Kelvin I hope you enjouy your scriptrunner journey. I think the relevant resource for you are: https://docs.adaptavist.com/sr4js/latest/features/behaviours/behaviours-examples/sub-task-default-field and…
-
This should be a good place to start: https://library.adaptavist.com/entity/dynamic-select Of course, this is for basing one single select on another, not adjusting the list in a cascading select. But it's virtually the same. Here is a sample script: import com.atlassian.jira.component.ComponentAccessor import…
-
Sometimes... a quick test is worth more than a ton of pre-existing knowledge... Just like a picture is worth... well you know the rest... So in short, yet they appear to be available despite not being explicitly called out in the documentation. Much of the core scriptrunner functionality is actually the same code-based…
-
Maybe you can try to do something like this: def targetObjType = 'Laptop'; def getObjType = {objectTypeFacate.loadObjectTypeBean(object.objectTypeId) } def timeout = 60000 //milliseconds def timer = 0 def waitInterval = 250 while (getObjType.name != targetObjType && timer<timeout){ sleep(waitInterval) timer += waitInterval…
-
I've only ever imported from CSV or Database sources. I can't imagine how JSON Import would work for comments. How does the mapping work? But if I was in your situation, I'd probably create all the objects first, then use the groovy console to import the comments as a second pass. Basically, the script would read the…
-
Where are you looking to do this search? Just randomly in a JQL filter? Or are you looking to automatically see all the "red" issues when you are viewing TICKET-12345? If the latter, then maybe a web panel using Scriptrunner Fragment might work well.
-
Ok, I found and installed the plugin with that gadget. This gadget doesn't support scriptrunner scripted field. It would appear that the gadget calls it's own internal API to get the list of valid date fields: <your jira base url>/rest/calendar-plugin/1.0/calendar/htmlcalendar/config/datefields Which returned just fields…
-
I think you'll have more luck getting some help if you provide a bit more context.
-
This will depend on the design of the gadget. I don't know which gadgets have the ability to select a custom date field. If you point me to a specific gadget and which add-on provides it, I can run some tests. On a "Filter Results" gadget I have no problem selecting a scripted date field
-
I'm not familiar with the calendar gadget and ultimately, the issue could be with that gadget specifically. But usually, when I've had issues finding a field in a gadget was because the "searcher" was not set correctly. So go to custom fields, find your script field in the list. Select Edit from the Action cog and change…
-
Enable the "fragment locator" (see the link in the fragment maintenance screen) to see where elements can be injected. In this case, this reference may help: https://developer.atlassian.com/server/jira/platform/issue-view-ui-locations/ I found that a weight of 200 will place the websection just before the description and a…
-
The "findByName" is an extension to the collection method that Adaptavist adds within scriptrunner. Change it to def issueType = constantsManager.allIssueTypeObjects.find{it.name == issueTypeName}
-
I think you'll find (if you search or view the value via rest that the correct value was persisted, however, when you edit, the behaviour fires again when the form fields are populated by jira. So you need to suppress the behaviour in those conditions: Wrap all the content of your method inside void setSystemFieldValue(){…
-
Yes this is possible with scriprunner. You can use either an escalation service job or a custom job. With the escalation service, you can specify the JQL to find those tickets right in the job definition form. For example: assignee in inactiveUsers() and resolution is empty The trick with the escalation job is that you'll…
-
This is because you are converting a list to a string then making another list with that string as a single element. Try def testIssue = [fields: [ project: [key: "${projectKey}"], labels: labelValue, issuetype: [id: '10413'] ] ]
-
I use the Clone Plus addon for that. The standard cloning functionality is very similar to what you are suggesting. Doing it with scriptrunner would be a lot of work
-
The way we achieve this is by using a "Insight Readonly Objects" custom field. This field will be linked automatically to the reporter field and populate the user object that is linked to the Jira User found in the reporter field. The IQL for the custom field will be like this: objectType = user and "Jira Account"=…
-
I haven't tried this specific scenario. But I have another case where I perform a MOVE using groovy code. And that move operation I found out took place in an asynchronous method. In other words, I start the move and the next line of code executes immediately. But in the background, the move is still happening. So I had to…