PD Sheehan Expert

Comments

  • Just trying to make sure I understand your example... You have 1 object type with 4 objects: A, B,C,D And 1 custom field that shows objects from the object type. But you want the custom field to show either A,B or C,D based on the Request Type (assuming JSM request type from the customer portal). You can't quite do that…
  • I have since had a need to develop support for table tags for myself, here is how I did it: import groovy.util.logging.Log4j import org.apache.log4j.Level import org.jsoup.Jsoup import org.jsoup.nodes.* /** * This is quickly put together class to convert HTML (typically from an Insight/Asset object rich text attribute) *…
  • @Steve Long -Evelon- Replace: links.allIssues.each{linkedIssue-> with links.getOutwardIssues('your link type').each{linkedIssue-> or links.getInwardIssues('your link type').each{linkedIssue->
  • In my experience, Scriptrunner trial licenses for DC have no feature restrictions. They are only time-bound. After 30 day, the app is locked until you either renew the trial or purchase the app.
  • You can review the full log by consulting the <jira-home>log/altassian-jira.log file. You can access that same log using the built-in script "view server log files". If you want, you can trap your error and then output a manageable number of stack trace messages so don't get flooded. try { //all your code here } catch (e){…
  • It appears this custom field will be provided by the Jira Misc Custom Field app. I suggest you refer to their documentation for more detailed instructions. But generally, the way a calculated script would work is that the value is calculated either each time the ticket is accessed or saved. This happens for each ticket…
  • When you use a template in confluence, it just populates the body.storage.value for your upon page creation. So if you want to do this from the rest API, you will have to first fetch the appropriate template, make changes to the storage value with your own content, then post it back to your confluence application. As far…
  • The "update" block should commit all the changes back to the database at once in a single transaction. I would check that you don't have automations or other listeners that are then firing and delaying the execution of the subsequent loop.
  • Hi Brady We use Configuration Manager for Jira (maybe a trial will suffice for you) to migrate project configuration from DEV to TEST to PROD. You should be able to do the same from your trial to your paid instance. Beyond that, there are no built-in tools to just migrate a project. 
  • As seen in this response it is not possible to add a tab to the Activity panel using scriptrunner. You would need to build a plugin using the SDK. However, it would be possible to create an entirely new panel (above or below the activity panel) to display a filtered view of the history details for a specific field. The…
  • I would highly recommend you enter a sub-query to make sure you don't attempt to evaluate this for all of your issues. But I think you will need to use a double-equal: issueFunction in expression('', 'Preestimate==Estimation')
  • While what Tuncay suggested in the other answer will work, in the context of a condition script on a scriptrunner field required validator, you can just access the resolution directly from the built-in "issue" variable. Your condition should work as a single line: issue.resolution?.name == 'Done' When the condition is…
  • To construct an URL in a groovy script, it's helpful to fetch the "BaseUrl" property for your instance. This way you don't have to hard-code the URL and the script will work even if you migrate to a different environment. import com.atlassian.jira.component.ComponentAccessor def baseUrl =…
  • Hi @Russell Kent Welcome to the Community. Here is a modified script based on the one in the library that will print out all the permissions for the selected group: import groovy.xml.MarkupBuilder import com.atlassian.confluence.internal.security.SpacePermissionManagerInternal import…
  • You must create your behaviour against the Fix Versions field so that the script is evaluated each time the field is modified. And the script can be greatly simplified compared to the other post. If you are just putting the script directly in the behaviour screen, you only need these 4 lines: def fixVersionField =…
  • Hi and welcome to the wonderful world of scriptrunner! Let's clarify some components of Jira/Scriptrunner. 1) Workflow Validator: whether provided by native Jira functionality, scriptrunner, or any other add-on, workflow validators execute AFTER the user clicks submit on a transition screen but before anything is saved. 2)…
  • Here is a simple SQL that will list all the projects and their components with some of the component details: Select p.pname, p.pkey, c.cname, c.description, c.LEAD, c.ASSIGNEETYPE, c.ARCHIVED, c.DELETED From project p Inner Join component c On p.ID = c.PROJECT You can decide whether or not to include archived or deleted…
  • The importSource only exists in memory within the script context You have to store it back after setting the status. importSourceConfigurationFacade.storeImportSource(importSource)
  • Hi @Saad Haq Welcome to the community! Presumably, the script you are creating to calculate the time in status is going to use the issue history to detect all the status changes and their timestamps. The move operation will also be found in the history. So it should be possible to filter the history data to only include…
  • As others have said, there is no built in change history for inline scripts stored in the database. And unless your file system on the server has some form of built in history tracking, then you’re out of luck. But I think that any script with any level of complexity (say more than about 10 lines) can stand to be managed…
  • I would simply execute a JQL search in your validator. Since you field is a text field, you must use a match operator (~). Then take all the matching issues and further refine them with an exact comparison. Here is a sample script (custom scriped validator): import com.adaptavist.hapi.jira.issues.Issues import…
  • Possibly, the reason is that your Asset field can contain more than one object. And even when a single one is selected, the expression still returns a list. I have no experience with automation expressions to advise you on how to get a single value from a list. But you could try with a native scriptrunner script. Either as…
  • findAll() will filter the collection. The closure must return a true or false to decide if the item in the collection should be returned collect() will transform the collection (it's called "map" in many other languages). A collect() will always return the same number of items as the original collection it was called on.…
  • @Manoj Kumar Gangwar posting an answer to your own question asking for help from someone in particular can be counterproductive. At least for me, I generally have a filter that only shows me questions without replies. So your question was hidden. Also, taking some time to properly format your code and detailing your…
  • setFormValue() for asset fields takes an array of asset keys. def objectList = {/* some code that gets the list of assest objects*/} formFIeld.setFormValue(objectList*.objectKey) If that doesn't work, share a bit of your code, I can see if I can help.
  • Hi there! By "migrating" you mean that you are attempting to populate the LDAP Picker field from external data of some kind? There might be ways to override that using the custom field configuration script, but I think by default, values are stored as "CN=cnvalueforuser" So try to include the "CN=" in your string to set…
  • When you specify ContentType.XML in your POST, HTTPBuilder should automatically parse the XML body groovy.xml.XmlSlurper. At first glance you code seems fine. What needs correcting? The only possible issue I see is that I don't think you need to manually set the Conte-Type header. Using the setting contentType in the post…
  • You can't just trigger a regular jira screen from a custom web item (button). If you want the button to prompt users for input, you will need to set that web item to "Run Code and Display a Dialog". That "run code" will have to be a custom REST enpoint that generates all the HTML for a dialog with whatever input fields you…
  • A lot will depend on what's required by your end point... But here is a sample that was used to generate a session on a system that requires login: import groovy.xml.MarkupBuilder import groovy.xml.XmlUtil import groovy.xml.slurpersupport.NodeChild import groovyx.net.http.ContentType import groovyx.net.http.HTTPBuilder…
  • I've tried to use the various soap libraries, but I was never satisfied with them. In the end, I've ended up just using groovyx.net.http.HTTPBuilder and the soap envelope and body using plain XML markupbuilder.