Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira links on create

Hi,

I am using JSU plugin to create linked issues from Project --to--> Milestone --to--> TASK. 

I need to close the TASK ticket as soon as it gets created if the Project ticket custom field value is OTHER. 

I tried doing fast track on TASK by looking at inward link to go Milestone and then to Project to get the value of custom field. Unfortunately not finding the inWard or OutWard links on create hence not finding the value of Project ticket custom field. Its getting failed. 

Links are getting established after all level of tickets get created. 

Even my FAST Track post function placed at the end on TASK Create workflow as shown below. Still it is not working.

TASK-postfunction.pngTASK-postfunction1.png

Condition written in FAST TRACK to find the value of Project ticket custom field value

 

////////////////////////////////////////////////////////////////////////////////////////

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.issue.MutableIssue

import com.atlassian.jira.issue.CustomFieldManager

import com.atlassian.jira.issue.link.IssueLinkManager

import com.atlassian.jira.config.SubTaskManager

import org.apache.log4j.Category

////////////////////////////////////////////////////////////////////////////////////////

//Used for testing on specific issue

//def IssueKey = "TEST-123"

//def issue = ComponentAccessor.getIssueManager().getIssueObject(IssueKey)

////////////////////////////////////////////////////////////////////////////////////////

//IssueManager issueManager = ComponentAccessor.getIssueManager();

////////////////////////////////////////////////////////////////////////////////////////////////

boolean Condition = false

//def issueLinkManager = ComponentAccessor.getIssueLinkManager()

//CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()

//Get all related issue links/Sub-tasks counts

def inLinkedIssues = issueLinkManager.getInwardLinks(issue.id)

            //log.info "(" + issue.key + ") is a CHILD ticket with: " + inLinkedIssues.size() + " PARENT issue(s)"

double countI = 0

def parentIssue

def aT_parent = customFieldManager.getCustomFieldObjectsByName("Activity Type").findByName("Activity Type")




    //Examine INWARD linked issues.

    if(inLinkedIssues.size() > 0 ){//This is a parent link

        //log.info "Counter at start of Inward links is:  " + countI

        issueLinkManager.getInwardLinks(issue.id).findAll {issueLink ->

            //log.info "Link type is:  " + issueLink.issueLinkType.name.toString()

            //List of all outward links that are NOT sub-tasks

            if (issueLink.issueLinkType.name != "is subtask of"){

                //log.info "(" + issueLink?.getSourceObject.getKey() + ") is a " + issueLink.issueLinkType.name.toString() +" of Parent-Task: "  + issue.key

                parentIssue = issueLink?.getSourceObject()

                log.debug "issuekey " + parentIssue.key

                            

                //increment ticket counter

                countI = countI + 1




            }

            

        }

        issueLinkManager.getInwardLinks(parentIssue.id).findAll {fooLink ->

                    def parentprojIssue = fooLink?.getSourceObject()

                    log.debug "Proj issuekey" + parentprojIssue.key

             def aT_parent_Val = parentprojIssue?.getCustomFieldValue(aT_parent)?.toString()

                log.info "Parent AT is: " + aT_parent_Val

                if(aT_parent_Val == "OTHER"){

                   log.info "True"

                    Condition = true

                                    

                }else{

                    log.info "False"

                    Condition = false

                }

             }

                        return Condition

    }else{

        log.info "TASK: Tailored transition: No links between TASK to Milestone"

    }

 

log showing message "TASK: Tailored transition: No links between TASK to Milestone"

Does anyone have any idea to achieve this scenario. 

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
Community showcase
Published in Team-managed projects

4 steps to get actual statuses on the Jira board.

Jira   is a powerful tool   that helps teams to plan, manage, and report on their work.   We love using Jira, especially for its ability to track issue progress. But how to monitor the...

1,160 views 10 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you