Comments
-
In our Jira project relation between Container and Epics established by two issuelinkage Some Epics have Inward issuelink with Container as "is Child of" and Some Epics have Inward issuelink with Container as "is relates to" How to handle this situation in script to cover above both issuelink types to get lastest (highest…
-
I don't understand what you mean can you illustrate the problem?
-
Is the code running? Not all errors in a script editor will prevent the execution. Sometimes, those errors are there only because the editor can't determine the type of a value. You can try something like this to force the error away: import com.atlassian.jira.issue.customfields.option.Option import…
-
The permission model is quite complex. A user could have access to a project via multiple project roles or group and other configurations in the permissions scheme. I would recommend you use the "custom picker" type of field instead. This way you can just call "Projects.getAllProjects()" to get all the projects the current…
-
It will be easier to diagnose your error if you share your full script and the exact location of the error. And yes, it is possible to achieve the same requirement with behaviour. However, workflow validators are more robust because they will also work in the case of API-triggered transitions. Behaviours provides more…
-
Put your script in a Custom Rest Endpoint. Then add a "Custom Web Item" fragment with "Run Code and DIspaly a flag" option and point the web item to your new endpoint. Make sure the endpoint returns a flag with something like "Your request to unarchive this project has been received. This may take a while. You will receive…
-
Yes, in this case, your js specified with jira.view.issue will be included for anyone who accesses any issues from any projects. But what I generally do for webpanels or dialog that require JS, is create a .js file that I then include as part of that panel's defintion. This way, the JS is sent along with the panel's HTML.…
-
I think this gets into the most complex type of customizations made possible by scriptrunner... but it's possible. You will need: * Custom REST endpoint (GET) to generate a dialog for users to select comments* The endpoint will accept an issue key as a query parameter * It will fetch all the comments on the supplied issue…
-
If this is run from within scriptrunner, you should be able to use HAPI to run that JQL search, then access, the resulting issue's custom field values. def issues = Issues.search(searchCriteria).collect() if(issues){ def workItemType = issue[0].getCustomFieldValue('Workitem Type') } But that assumes that the Workitem Type…
-
Hi Charlie I pondered your use case a bit and came up with the following... 1) From a script runner post function, you can read the comment supplied by the user (or a template tool) using the transentVars variable in the binding. 2) Using groovy GStringTemplateEngine, you can interpret code in ${} in the comment. Put…
-
Hi Dayanand If I understand correctly, you want the due date to automatically roll up from issues->Epic->Container so that if an issue is updated to a later due date than anything else in the current chain, the epic and container will both reflect this new date. The best approach I can think of for this is probably a…
-
I couldn't get your example to work. But I think what's likely happening is that the scriptrunner/groovy framework is compiling the script into some java class and the csvMapList is instantiated just once when the class is compiled or your application starts. That's why when you change the script, the file is reloaded (the…
-
You have a few errors in there: This line if (failureCount <= maxFailures) means that you'll only send the first 5 failures then stop. In your initial getApplicationProperty, you are fetching 'failureCount', but then storing just 'count' This script will count global failures. If you have multiple configurations, it would…
-
I'm not sure. I haven't messed with that sort of scenario. In terms of non-deprecated alternatives for getting all groups in your instance there is now a "getAllGroupNames" method in the GroupManager class. Or you can use the GroupPickerSearchService import com.atlassian.jira.bc.group.search.GroupPickerSearchService import…
-
@Muhammad yeah, that's a starting point. So far, in the way I have had to use this (copying Asset rich text into Jira wiki rich text field), I've never needed tables. Feel free to expand on it.
-
It took me a while working with scriptrunner to understand the difference between static and non-static classes and methods (I don't have any formal software development education). The short and long of it is that if a class has global variables that are accessed by the methods then you need to create an instance of that…
-
No, my bad, the instructions were slighly incorrect. I had forgotten how the class was implemented (non-static), and wrote the example from memory. This should work def wikiText = new HtmlWikiConversionUtil().convertHtmlToWiki(assetHtmlText)
-
@Brent Nye can you give me a bit more context on what you are trying to achieve in your behaviour? But here are some generic tips. * Make sure your scriptrunner/jira installation is configured to use script roots correctly * Create a new file via the Script Editor in a location of your choice and paste my code. The file…
-
Actually… I don’t think I thought my earlier response all the way through. The system due date field is a date picker only field if I recall correctly. So it would not be able to display the time even if it was stored in the db. So the api will just ignore the time portion and store midnight. I don’t think that there is…
-
If the source custom field is a Date Time picker, then the system date field will also contain the time after copying the data from the source custom field to the system date field. But if the source custom field is a Date Picker, it is by convention stored with a time of midnight and will be copied as such. You can't…
-
I built my own groovy class to help with that. It may not work in all use cases, but it might be a starting point for yours. 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…
-
As mentioned by @Ignacio Aredez GenAI Expert jira doesn't natively store login activity. Only the last login. But you could use a scriptrunner listener to catch the login event and create your own logging for that separate from the native jira logs.
-
Right or wrong, my approach for doing things like this is to write a javascript file that I include in my HTML dynamically. This javascript file includes functions to call other API and manipulate the DOM element on the custom form Here is how you can include a scriptfile from your scriptrunner scriptroot: xml.script(type:…
-
Scripts that were designed with Service Desk APIs will not work if that application is installed. If the script did anything else, you'll need to redesign the script so that they don't use those features anymore. And if you want to update data between instances whether it's native jira data or service desk data, you can't…
-
I don't recall if that code used to work on older Jira versions, or if I just made a typo in my original answer. There are 2 ways you can get that component from scriptrunner with current versions: TrustedRequestFactory trustedRequestFactory = ComponentAccessor.getOSGiComponentInstanceOfType(TrustedRequestFactory) Or…
-
Hi @Rob B Yes, using a Behaviour server-side script, you can make 2 fields co-required. I.e. at least A or B must be populated. Here is how you might do that. 1) In field A, add a server-side script def fieldA = getFieldByName('A Name') def fieldB = getFieldByName('B Name') fieldB.setRequired(!fieldA.value) 2) in field B,…
-
THe searchProvidor compoent returns a "documentWithId" object from the lucene search index. It will be up to you to convert that to a class that the changeHistoryManager can handle. Somethinkg like this: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.search.SearchProvider import…
-
Support for Groovy scripting has long history in the atlassian community forums. There used to be a dedicated group for that, but since last year's restructuring, it's less obvious. Maybe those questions would better be served in the App Central group, I don't think that really matters. If you are not prepared to offer…
-
With the OptionsManager interface, you can retrieve the list of options, sort it in memory and adjust the sequence field for each option, then use "updateOptions()" to save the new sorted list.
-
I'm not sure what you were trying to do with that code, but it was a bit of a mess. This here should get you something that works and you can adjust the render options: import com.atlassian.jira.bc.project.component.ProjectComponent import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue…