Comments
-
Here is a sample groovy script to return all the comments from an object given its key: import com.atlassian.jira.component.ComponentAccessor def objectKey = "{{objectKey}}" def classLoader = ComponentAccessor.pluginAccessor.classLoader def ObjectFacadeClass =…
-
You might need to extend your SIL using the SIL Groovy Connector. Then use the native JAVA API to fetch the comments. Here is an example of how the SIL Groovy Connector can call a groovy script. https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15488333/Passing+Values+Between+SIL+and+Groovy
-
Either via the type-ahead or the magnifying glass, the list is subject to whatever IQL filter you've applied in the custom field context. If you want a different list in the portal vs jira, then you need to have an IQL that will render differently based on default values and IQL placeholders. If you can have a custom field…
-
Look at those: https://mvnrepository.com/artifact/com.atlassian.servicedesk/insight-core-model https://mvnrepository.com/artifact/com.atlassian.servicedesk/insight-core-services
-
The insight groovy framework is a lot more barebones than the scriptrunner one. You will not have access to any com.onresolve... classes in the Insight groovy framework. So WithPlugin and PluginModule won't be possible. As for your shared classes, the only way I've found to use them is to load them using the classloader.…
-
You can go review the javadocs for each of those events: LoginEvent, LogoutEvent, LoginFailedEvent Or output some details to the log to see what's available in each class and build out a script that can show you those details. E.g. import com.atlassian.jira.event.user.LoginFailedEvent import…
-
Can you post your full script again? Not as images, please post as text with and correctly formatted as "Code Block". Make sure all the carriage returns are correct (sometimes, in copying code to the rich text in the community, some lines get smooshed together). Also post the detailed logs that get posted to the post…
-
First off... it's bad practice in Java/groovy to capitalize variables. Then it becomes too difficult to differentiate between class names and instances of classes. But if your "Values" variable contains an ArrayList and you want each of them to generate an ObjectAttributeValue, you can't cast it as a String. You must cast…
-
Hi @Krzysztof Not sure if you got from the thread that all my advice were only applicable to server/dc. If you're on cloud, I can't help. But for server, I have no issue accessing the user with: def user = (event as LoginEvent).user //returns ApplicationUser
-
Iterating through all the objects would be very inefficient, especially if the number of objects gets big. I would recommend instead you leverage the IQLFacade and perform an IQL search. If the search returns a result, then the object already exists. Something like this: import…
-
I have no experience with Jira cloud.
-
Sorry, I missed that fact (about not having scriptrunner). Here is a version without scriptrunner shortcuts: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.fields.CustomField import…
-
Presumably, your user object type in Insight has an attribute of type Jira User. Or at least a user name or something else that we can use to find the user based on the selected users in the user picker. So you should be able to use the iqlFacade to search for the user object and then retrieve the attributes that way.…
-
I would suggest you query all the details of either another locked field from that addon or the same field in a different instance to view all the attributes of the mci. Then remove the fields from the managed configuration and add it back with the missing property. For example, the only managed items I have are related to…
-
There is an insight/asset facade for dealing with ObjectSchemaBean You can get the full list of Schema with this code: import com.onresolve.scriptrunner.runner.customisers.PluginModule import com.onresolve.scriptrunner.runner.customisers.WithPlugin import…
-
I have several pointers: 1) it is best practice in java and groovy to reserve the initial cap for class names. Instances of those classes or any other variables should start with a lowercase. So @PluginModule ObjectTypeAttributeFacade objectTypeAttributeFacade //and def systemApprover = 'System approver' Rather than…
-
I'm not familiar with the SumUp plugin and how it stores its values. But it would seem that when you return "value" from getCustomFielValue, it returns an object of some kind that doesn't have an automatic "toString" method. If you're not sure what that value is, you can output its class as a debug step.…
-
The closest I can find is ProgressFacade. But there is no method to list all the recent progress results. It might be behind some hidden/internal API. The only option I can think of is to query the db directly (AO_8542F1_IFJ_PRG_RES).
-
The following makes no sense: def project = ComponentAccessor.projectManager.getProjectByCurrentKey("INTB2BSSD") if (project.key == 'INTB2BSSD') { You hardcode a project lookup then check that the project is the one you just hardcoded? No. You need to use the information from your event to find your project. The best way I…
-
Note that the in-line edit appears to be available, but if you attempt to click on the field to start editing, you will get the full edit screen pop up.
-
Generally, just the fact of listing a field in a behaviour configuration will generally disallow in-line editing. But you can call it out explicitly getFieldByName('some field').setAllowInlineEdit(false)
-
Have you tried the "Cascading Select" field? You are describing exactly the way a Cascading select field works.
-
@Jyoti Kumari it is not possible to conditionally show/hide fields in the view screen. All you can do is disable the in-line edit and force the full edit screen to open when someone attempts to in-line edit. The only way to hide a field from the view screen is to remove it from the field configuration.
-
With jira 9/jsm 5 insight is being rebranded “assets” in its version 10 And I think the 9x version of the Java doc was a mid point between the riada documentation. That’s why it still had some bugs and bad links. I expect most of the functionality to be roughly equivalent between Insight 9 and Assets 10.
-
I found the latest here: https://docs.atlassian.com/assets/10.4.4/
-
I am not sure that updating a custom field this way in project automation via groovy is a good idea. Also, I don't know if you rick getting concurrent update issues or if the change will be logged and indexed. So use at your own risk. But for the logic to work, you need to compare the "Option.getValue()" result against…
-
Here is the lastest I could find: https://docs.atlassian.com/assets/10.4.4/ This seems to have correct internal references.
-
Yeah, I'd second this. If you have a csv import, include a dummy column. If you have a database import, include a simliar dummy column in the sql selector. Anything else left empty, can be assumed to be an LDAP import. If you have 2 separate ldap imports and you want to identify ldap1 vs ldap2, then you'll need to use…
-
There is no reason for a for-loop to break anything. But how does the for-loop break your behaviour? What errors are you getting? What gets outputted to your log?
-
Ah I see, the other issue was that you can't include the path in the URL when creating the client then try to set it to empty when calling the post method. Try it like this (I also added a failure handler): import groovy.json.JsonOutput import groovyx.net.http.ContentType import groovyx.net.http.HttpResponseDecorator…