Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

create alm defect as sub task in jira

 
1
0
-1

Hi ,
i have the following question regarding the alm defect

If I am working on an enhancement ex:enhancement1 and I have two bugs reported for that enhancement ex:BUG1 and BUG2

Now my requirement is to show these two bugs created in alm transfer to jira and shown under Jira parent ticket (either as subtasks ,or links or dependent issues )

How to achieve that ?

Right now all the defects which are created in ALM are transferred to JIRA as a seperate ticket ,but i wanted to show them further under another JIRA parent ticket (which is our enhancement ticket)

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      What you can do is set the parent id of the newly created ticket as in


      if (firstSync) {
         issue.typeName = "sub-task"
      
         // assume that 10 is the issue id of the parent
         issue.parentId = 10 as Long 
      }



      Once that you got this working, you should add the logic to search the parent.
      Search can be implemented by instantiating the right Jira services.  An example for this is provided in following snippet.



      1. SANDEEP ADE

        got the below error


        in the above example if parent issue is a string ,what will be the code ?


      2. SANDEEP ADE

        I added the below lines 


        issue.typeName = "sub-task"
        issue.parentId = "DS-42724" as Long

      3. Francis Martens (Exalate)

        You can't convert 'DS-42724' to number because 'DS-42724' is not a number ...
        Do you understand?

        the issue.parentId expects the id of the parent.  DS-42724 is probably the issue key.  So you will have to look up the id corresponding of that issue.


        Give it a try.




      4. SANDEEP ADE

        i will pass the Jira parent id from alm (in alm this field is a number) and i want to assign this number to Jira parent id


        so what should be the outgoing sync (in alm ) and incoming sync  (in jira) ?



        i have below two lines but its not working,is the below correct ?


        outgoingsync from alm where JIRAParentId is number ex : 10

        replica.parentId = issue.customFields."JIRAParentId"


        incoming sync

        issue.parentId = replica.parentId as Long



      CommentAdd your comment...