Help to understand Adaptavist, beginner where i begin ?

tania_bernal_ssss_gouv_qc_ca March 22, 2019

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)

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2019

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)
}

}

Suggest an answer

Log in or Sign up to answer