Are there video or beginner tutorials ( i know the official webSite) for the code adaptavist.
It's really not easy even with a good programming base.
I really can not code my pseudoCode and I would like to become better.
1. What I'm trying to do is looping through the tasks of an epic
if my custom field "Service" = "dodo"
2. Take the end date of the task (personality field)
and memorize it
if my custom field "Service" = "dada"
take the date you have memorized and put it in a custom field start date.
Thank you for reading (note: I used google translation to write this text I apologize for the syntax)
There's no real tutorials I think are any good for free, but I've learnt scriptrunner by reading public scripts and adapting the bits I need. That was a long time ago and since we (Adaptavist) took it on, we've been trying to build more help for using it.
https://learn.adaptavist.com/course-library has a course for getting started, and https://library.adaptavist.com is a small but growing free library of scripts (curated by the people who use and maintain Scriptrunner - heck, even two of mine have made it in after tidying!) which I steal from regularly.
Anyway, on to the scripting. You'll need to build around this, but the core of the code you need is:
To keep it simple, I'm going to assume you are working in a post-function. These have direct access to the current issue being transitioned, so the variable "issue" will have your Epic in it.
def linkedIssues = issueLinkManager.getOutwardLinks(issue.id).findAll { it.issueLinkType.name == "Epic-Story Link"}
*.destinationObject?.findAll
That gets you the list of issues in the Epic, so you can then say
linkedIssues.each {
def linkedIssue = it.destinationObject
if (linkedIssue.getCustomFieldValue(cfService) == "dada") {
startdate = linkedIssue.getCustomFieldValue(cfEndDate)
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.