PD Sheehan Expert

Comments

  • Have you tried with contentType = ContentType.BINARY I have no experience using HTTPBuilder.setClient() methods.
  • There are a few different directions you could use for this * Behaviour Select Conversion - live* User field will be "Test" * Behaviour script will change it to select dropdown based on the current project context * Remote API is called with each user input * Behaviour Select Conversion - stored data* Same as above but api…
  • Most of the other configs are in jira application properties stored as json strings. You can retrieve them from the db using SQL: Select e.PROPERTY_KEY, t.propertyvalue As Text, s.propertyvalue As String From propertyentry e Left Join propertytext t On e.ID = t.ID Left Join propertystring s On e.ID = s.ID Where…
  • Yeah it's probably possible to get the csv file from the issue. But that won't help with loading the CSVReader class. That means you will have to code your own parser.
  • I use Clone Plus for this purpose: https://marketplace.atlassian.com/apps/44043/clone-plus-for-jira?hosting=server&tab=overview You would probably spend more on consultancy fees to achieve the same purpose that that plugin would cost over the next 5 years.
  • I don't think insight looks at AD groups ... it look at Jira groups. But reading the documentation: https://insight-javadoc.riada.io/insight-javadoc-8.6/insight-rest/#object__id__put The API expects the User's userKey ... not the user's username. The key is something like JIRAUSER12345 in recent jira versions (they used to…
  • I know that it seems like it would not be all that hard ... but scriptrunner doesn't implement the same type of webwork actions that the built-in jira does. So, what you would need to do, it using 100% custom groovy code, access the screen definition object to find the list of custom fields. Then for each custom field,…
  • Are you talking Server/DC or Cloud I wonder where you see this "Origin" field in searches. I have a "Channel" field visible on JSM issue view which can contain the values or Jira, Portal or Email. Maybe on cloud it's called Origin? In my server case, "Channel" is a JSM issue property, not an actual field. You should be…
  • Try putting the script tag just before the close of the <section>. You might want to explore using the MarkupBuilder to create your form. In my opinion, it is easier to manage than a huge long string. Especially if you have to repeat information such as for your table. Here is your script converted up to the first field,…
  • You could try with something like this //your original imports here import java.time.ZoneOffset def utcHour = new Date().toInstant().atOffset( ZoneOffset.ofTotalSeconds(0)).hour if(utcHour >=4 && utcHour < 16){ //the rest of your script here }
  • Hi Are your existing components spelled exactly like "Example1","Example2" Have you reviewed the atlassian-jira.log file to see if there are any errors? Add some logging and review the log files to get progress on your script's execution: log.info "script is reporting the current screen as $actionName" if (getActionName()…
  • The @grab line requires access to the internet. It will actually download some files for you and store them in a directory owned by the user that jira is running the application. On linux, it would be something like /home/jira/.groovy/com.opencsv etc Those files are downloaded…
  • I don't think that this solution will help you. I think a Scripted Listener will be better suited. Project Automation configs are a form of listeners. When EVENT then do ACTION. So, we can do the same thing with the scripted listener. From your scriptrunner admin screen, go to the Listener Tab Click create listener, then…
  • The file has to be available at the file system level. So if you don't have access to that, an option is to put your csv in a google sheet. Then in sheets, go to file/publish to the web. Follow the instructions and get the URL for accessing the sheet as a csv. Then in scriptrunner you can access it with import…
  • When I need to read a csv for anything, I do it like this: import com.opencsv.CSVReader @Grapes( @Grab(group='com.opencsv', module='opencsv', version='4.2') ) def filePath = '/path/to/file/test.csv' def reader = new CSVReader(new FileReader(new File(filePath))) def data= reader.collect { it }.with { rows -> def header =…
  • If you will be using this "robot" user, presumably you know its password. Then I would recommend you use the simpler RESTClient to make your calls. import com.atlassian.applinks.api.application.confluence.ConfluenceApplicationType import com.atlassian.sal.api.component.ComponentLocator import…
  • I would write it like this: import com.atlassian.jira.issue.IssueConstantImpl def priority = getFieldById(getFieldChanged()) def selectedPriority = ((IssueConstantImpl) priority.value).name def SV = getFieldById("duedate") def isToTime = selectedPriority == "To time" SV.setHidden(isToTime).setRequired(!isToTime)
  • Nic is 100% correct of course. And I used to not care so much ... but there are places where it becomes annoying to get all those static errors and it's nice to make them go away and it's very satisfying to get that green dot under your script. So in your case, since you call ?.value on your custom field value, I'll assume…
  • Scriptrunner can't come between Jira and your browser when serving up comments. That's controlled by the internal permission system in jira. What can scriptrunner do? * Make changes to just about any jira entity that can be done in the ui (add/remove user to roles and groups, change issue or comment attributes etc) * Hide…
  • To implement this as a behaviour, you would want to assign the same behaviour script to each field. That might be tedious, but by using a script file and pointing each field to the same file, at least you would have a central place to maintain the file. Here is my attempt at reverse engineer your logic a best as I…
  • I'm assuming your fragment is some sort of web panel. And since you want to display on the create screen, then you probably used a location such as servicedesk.portal.header or subheader. I gave that a try and outputted all the binding variables to log with log.info "\n${binding.variables.collect().join('\n')}" And I saw…
  • Normal create screen don't generally include an "epic link" field. So this script should work.
  • I've only had 1 use case for creating an object from code.... and it was quite specific and embeded into a larger script. I did not attempt to generalize it for including in this class. I will update here and in the repository if/when I create that case.
  • You will have a similar issue though. You won't see the change in PI Review until you save the change to Closure Code. What changes the closure code? Is this via some automation or some other external source? Or is that a user-triggered change? If user-triggered, that I don't see why you can't keep using the current…
  • Oh wait I now see this comment from you I only see the change in the history tab after I press the update button, not after the value is changed by the behaviour. That is completely expected. That's what behaviour does. Changes the values on the screen and lets the user submit the change. List any other changes on the…
  • What you are experiencing just makes no sense to me ... Behaviors work by modifying the form value on the browser side. Just like a person would with keyboard and mouse. The edit/create/transition screen submit should take care of updating the database and index. If you want to have changes take effect AFTER the update,…
  • That is shorthand for if(parentDate != null){ if(parentDate < DateValue){ //do something } } with && the first term is evaluated ... if it is true, then the second term is evaluated. This way, we don't try to compare a null date against a valid date. If the date is null, we exit the condition immediately.
  • You can use your chrome developer tool and examine all the network calls to rest/scriptrunner/behaviours/latest/validators.json and rest/scriptrunner/behaviours/latest/runvalidator.json Here is what I've deduced from that.. * When you first access an issue or open a screen the validators.json api is called to get all the…
  • Can you view the PI Review value after the change is applied by behaviour and you submit the form in the issue view? Does it show the new value? What about in the change history tab? I can't see why it would make a difference, but can you try to change piReview.setFormValue("11328") to piReview.setFormValue(11328L)
  • I disagree with Juan ... with Behaviours, there is no indexing impact. The form fields are updated live in your browser just like a human would using keyboard and mouse. When you submit the form, the changes are stored in the DB and the index is refreshed. Do you see similar delays for changes you make manually appearing…