1
0
-1

Hi Team,
I am very new to Exalate, I am trying to establish a connection between two Jira projects. The two Jira projects are identical. 

The projects are located in the Datacenter and Jira cloud. 
The cloud and Jira follow their own issuetypes and statuses.
When a ticket is created in the Jira Data center, a ticket should be made in cloud jira with the same data and vice versa.
I have successfully established a connection between Data Center and to Cloud, so when a ticket is created in the Datacenter with the help of a trigger a new issue is created in the cloud jira.
But, now when a new ticket is created in Jira cloud, in the Datacenter no ticket is created. Can you please help me with how this can be done?

This is my outgoing sync in Jira cloud
replica.key            = issue.key
replica.type           = issue.type
replica.assignee       = issue.assignee
replica.reporter       = issue.reporter
replica.summary        = issue.summary
replica.description    = issue.description
replica.labels         = issue.labels
replica.comments       = issue.comments
replica.resolution     = issue.resolution
replica.status         = issue.status
replica.parentId       = issue.parentId
replica.priority       = issue.priority
replica.attachments    = issue.attachments
replica.project        = issue.project
//Comment these lines out if you are interested in sending the full list of versions and components of the source project.
replica.project.versions = []
replica.project.components = []
/*
Custom Fields
replica.customFields."Summary" = issue.customFields."Summary"
replica.customFields."Fix Versions" = issue.customFields."Fix Versions"
replica.customFields."Priority" = issue.customFields."Priority"
replica.customFields."Labels" = issue.customFields."Labels"
replica.customFields."Sprint" = issue.customFields."Sprint"
replica.customFields."Description" = issue.customFields."Description"
replica.customFields."Attatchments" = issue.customFields."Attatchments"
replica.customFields."Story Points" = issue.customFields."Story Points"
replica.customFields."Start Date" = issue.customFields."Start Date"
replica.customFields."Due Date" = issue.customFields."Due Date"
replica.customFields."Client External ID" = issue.customFields."Client External ID"
replica.customFields."Linked Issues" = issue.customFields."Linked Issues"
replica.customFields."Environment" = issue.customFields."Environment"
*/


This is my Incoming sync in Jira cloud side.

if(firstSync){
   issue.projectKey   = "PILOT2"
   // Set type name from source issue, if not found set a default
   issue.typeName     = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "BRD"
}
issue.summary      = replica.summary
issue.description  = replica.description
issue.comments     = commentHelper.mergeComments(issue, replica)
issue.attachments  = attachmentHelper.mergeAttachments(issue, replica)
issue.labels       = replica.labels
issue.status       = replica.status
issue.type         = replica.type
def statusMappingStory = ["Refinement":"In Review", "Not Started":"Open", "In Progress":"In Progress", "Ready for Test Release":"Peer Review", "Ready for QE":"QA", "QE - Complete":"Acceptance Testing", "Done":"Closed", "Duplicate":"Closed", "Won't Do": "Closed", "Need More Info":"In Review"]
def remoteStatusNameStory = replica.status.name
issue.setStatus(statusMappingStory[remoteStatusNameStory] ?: remoteStatusNameStory)
def statusMappingBug = ["New":"In Review", "Not Started":"Open", "In Progress":"In Progress", "Ready for Test Release":"Peer Review", "Ready for QE":"QA", "QE - Complete":"Acceptance Testing", "Done":"Closed", "Duplicate":"Closed", "Won't Do":"Closed", "Rejected":"Closed", "Ready for Retest":"In Review", "Monitor":"In Review", "Reopen":"In Review"]
def remoteStatusNameBug = replica.status.name
issue.setStatus(statusMappingBug[remoteStatusNameBug] ?: remoteStatusNameBug)
def statusMappingSpike = ["Refinement":"In Review", "Backlog":"In Review", "Not Started":"Open", "In Progress":"In Progress", "Ready for QE":"QA", "QE - Complete":"Acceptance Testing", "Done":"Closed", "Won't Do":"Closed", "Need More Info":"In Review", "Reopen":"In Review"]
def remoteStatusNameSpike = replica.status.name
issue.setStatus(statusMappingSpike[remoteStatusNameSpike] ?: remoteStatusNameSpike)
//def statusMappingEpic = ["New":"In Review", "Refinement":"In Review", "Not Started":"Open", "In Progress":"In Progress", "Ready for Test Release":"Peer Review", "Ready for QE":"QA", "QE - Complete":"Acceptance Testing", "Done":"Closed", "Duplicate":"Closed", "Won't Do": "Closed", "Need More Info":"In Review"]
//def remoteStatusNameEpic = replica.status.name
//issue.setStatus(statusMappingEpic[remoteStatusNameEpic] ?: remoteStatusNameEpic)
//def typeMapping = ["Bug":"Project Bug"]
//def remoteTypeName = replica.type.name
//issue.setType(typeMapping[remoteTypeName] ?: remoteTypeName)
def issueTypeMappingBug = ["Bug" : "Project Bug", "Spike" : "BRD", "Story" : "Story"]
//issue.typeName = issueTypeMappingBug[replica.type?.name] ?: "Project Bug"
//def issueTypeMappingSpike = ["Spike" : "BRD"]
//issue.typeName = issueTypeMappingSpike[replica.type?.name] ?: "BRD"
//def issueTypeMappingEpic = ["Epic" : "Technical Review"]
//issue.typeName = issueTypeMappingEpic[replica.type?.name] ?: "Technical Review"
/*Move.receive(
    ["PILOT":"PILOT2"],
    ["Bug":"Project Bug","Spike":"BRD","Epic":"Technical Review"],
    [:],
    replica,
    issue
    )*/
/*
User Synchronization (Assignee/Reporter)
Set a Reporter/Assignee from the source side, if the user can't be found set a default user
You can use this approach for custom fields of type User
def defaultUser = nodeHelper.getUserByEmail("default@idalko.com")
issue.reporter = nodeHelper.getUserByEmail(replica.reporter?.email) ?: defaultUser
issue.assignee = nodeHelper.getUserByEmail(replica.assignee?.email) ?: defaultUser
*/
/*
Comment Synchronization
Sync comments with the original author if the user exists in the local instance
Remove original Comments sync line if you are using this approach
issue.comments = commentHelper.mergeComments(issue, replica){ it.executor = nodeHelper.getUserByEmail(it.author?.email) }
/*
Status Synchronization
Sync status according to the mapping [remote issue status: local issue status]
If statuses are the same on both sides don't include them in the mapping
def statusMapping = ["Open":"New", "To Do":"Backlog"]
def remoteStatusName = replica.status.name
issue.setStatus(statusMapping[remoteStatusName] ?: remoteStatusName)
*/
/*
Custom Fields
This line will sync Text, Option(s), Number, Date, Organization, and Labels CFs
For other types of CF check documentation
issue.customFields."Summary".value = replica.customFields."Summary".value
issue.customFields."Fix Versions".value = replica.customFields."Fix Versions".value
issue.customFields."Priority".value = replica.customFields."Priority".value
issue.customFields."Labels".value = replica.customFields."Labels".value
issue.customFields."Sprint".value = replica.customFields."Sprint".value
issue.customFields."Attachments".value = replica.customFields."Attachments".value
issue.customFields."Description".value = replica.customFields."Description".value
issue.customFields."Story Points".value = replica.customFields."Story Points".value
issue.customFields."Planned Start Date".value = replica.customFields."Start Date".value
issue.customFields."Due Date".value = replica.customFields."Due Date".value
issue.customFields."External ID".value = replica.customFields."Client External ID".value
issue.customFields."Linked Issues".value = replica.customFields."Linked Issues".value
issue.customFields."Environment".value = replica.customFields."Environment".value
*/

  1. Ariel Aguilar

    Hi there!

    Have you tried setting up a trigger in the Jira Cloud side?

    Kind regards,

    Ariel

CommentAdd your comment...

2 answers

  1.  
    1
    0
    -1

    Hi Ariel Aguilar ,
    The DC is behind the firewall, I established a private connect from the cloud to DC

     Regards,

    Jithendra

      CommentAdd your comment...
    1.  
      1
      0
      -1

      Hi Ariel Aguilar ,
      Thank you for your assistance,
      I have enabled the triggers at both ends
      and also added the Incoming script with the mapped status. When I try exalate an issue from the connection this is where the synchronization is stopped. "Waiting for Remote"


      Please find the below sample code on the remote side

      f(firstSync){
        issue.projectKey  = "PILOT"
         // Set type name from source issue, if not found set a default
        issue.typeName    = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Story"
      }
      issue.summary     = replica.summary
      issue.description = replica.description
      issue.comments    = commentHelper.mergeComments(issue, replica)
      issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
      issue.labels      = replica.labels/*
      User Synchronization (Assignee/Reporter)Set a Reporter/Assignee from the source side, if the user can't be found set a default user
      You can use this approach for custom fields of type User
      def defaultUser = nodeHelper.getUserByEmail("default@idalko.com")
      issue.reporter = nodeHelper.getUserByEmail(replica.reporter?.email) ?: defaultUser
      issue.assignee = nodeHelper.getUserByEmail(replica.assignee?.email) ?: defaultUser
      */def statusMap = ["In Review": "Refinement", "Open": "Not Started", "In Progress": "In Progess", "Peer Review": "Ready for Test Release", "QA": "Ready for QE", "Acceptance Testing": "QE - Complete", "Closed": "Done", "Closed": "Duplicate", "Closed": "Won't Do", "In Review": "Need More Info"]def remoteStatusName = replica.status.name
      issue.setStatus(statusMap[remoteStatusName] ?: remoteStatusName)/*
      Comment SynchronizationSync comments with the original author if the user exists in the local instance
      Remove original Comments sync line if you are using this approach
      issue.comments = commentHelper.mergeComments(issue, replica){ it.executor = nodeHelper.getUserByEmail(it.author?.email) }
      *//*
      Status SynchronizationSync status according to the mapping [remote issue status: local issue status]
      If statuses are the same on both sides don't include them in the mapping
      def statusMapping = ["Open":"New", "To Do":"Backlog"]
      def remoteStatusName = replica.status.name
      issue.setStatus(statusMapping[remoteStatusName] ?: remoteStatusName)
      *//*
      Custom FieldsThis line will sync Text, Option(s), Number, Date, Organization, and Labels CFs
      For other types of CF check documentation
      issue.customFields."CF Name".value = replica.customFields."CF Name".value
      */


      Please help me on where it went wrong?


      Thank you,

      jithendra

      1. Ariel Aguilar

        Hi again,

        This problem might be a connection problem. Is the DC side private or behind a firewall?

        Regards,

        Ariel

      CommentAdd your comment...