Questions for Confluence license has expired.

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

Groovy, how to get connection-information

 
1
0
-1

I like to implement some logging information in the connection-rules. As example, I have the following working example (Jira Server and Exalate 5.0.4-j8):


def allowedIssueTypes = ['Task', 'Story', 'Bug']
log.warn("Check for valid Issue-Types = " + replica.type?.name)
if (!allowedIssueTypes.contains(replica.type.name)) {
	log.warn("Check for valid Issue-Types : Issue-Type = " + replica.type.name + "is not allowed. The issue with key " + replica.key + " will not be synchronized to hosting-zone. Check the trigger, the issue type should be excluded from synch trigger !")
return
}



I couldn’t find a script-helper or other information, how to access the connection-information. I like to add the current connection name to the log-message. How can I do that ?


Thanks
Adrian Suter


    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Hello Mariia,


      i can find a lot of those objects at https://docs.idalko.com/exalate/display/ED/Issue+fields+available+for+synchronization. But i couldn't find a list of the object types like "connection".

      Do you have a link for me what kind of objects i can access from groovy within the outgoing and incoming rules ?


      Thanks

      Adrian

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

        Hello Adrian,

        Current connection name is an object, so you can use

        connection.name 
          CommentAdd your comment...