Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

Abstract

This code snippet calculates and creates a summary of last comments added on the issues linked to the current issue through a specific link type

Logic

  • Iterate over each linked issue linked to the current issue through the specified link type
  • Fetch the last comment on each linked issue and store in a variable

Snippet

def summ = ""
if(issue.getLinkedIssues("<Link type name>")==null)
return null;
issue.getLinkedIssues("<Link type name>").each{
  if(it.get("comment")){
    comm = it.get("comment").last()
    summ += "Comment on " + it.key + ": " + comm.getBody() +", created on " + comm.getCreated().format("dd/MMMM/yyyy hh:mm a") + " by " + comm.getAuthorFullName() + "\n"
  }
}
return summ

Placeholders

Placeholder

Description

Example

<Link type name>Name of the link typeis cloned by

Examples

The output of the code snippet is a String which you could use in a Groovy script, for example, to calculate and display a summary of last comments added on the issues linked to the current issue through the "is cloned by" link type.

def summ = ""
if(issue.getLinkedIssues("is cloned by")==null)
return null;
issue.getLinkedIssues("is cloned by").each{
  if(it.get("comment")){
    comm = it.get("comment").last()
    summ += "Comment on " + it.key + ": " + comm.getBody() +", created on " + comm.getCreated().format("dd/MMMM/yyyy hh:mm a") + " by " + comm.getAuthorFullName() + "\n"
  }
}
return summ

References

  • No labels