2
1
0

Greetings,


We have a ServiceNow-Jira integration. When a comment is integrated from ServiceNow to Jira, the comment adds to the body "${author_username} commented: ${body}"


Our client has asked if we can change that username for the author's fullname, but we found that the information we're recieveing in Jira from ServiceNow comments is as follows:



So no fullname for the author, just the key. Is there a way to format these comments on ServiceNow outgoing sync, before being sent to Jira?


Thanks in advance, kind regards,
Alvaro.

    CommentAdd your comment...

    1 answer

    1.  
      2
      1
      0

      Hello, Alvaro Jardon
      Thanks for reaching out on community!
      Here's the code I used in my outgoing script on SNOW to make it work:

          replica.comments = replica.comments
            .collect { c ->  
                def authorKey = c.author.key
                def a = nodeHelper.getUserByUsername(authorKey)
                if(a) {
                    c.author = a
                }
                c
            }

      And here's a video showing how it worked out in Jira 🍿: 
      Let me know if it also works for you!
      Regards, Serhiy.


      1. Alvaro Jardon

        Hi Serhiy Onyshchenko,


        Thanks for the help, that did work correctly, thank you!


        Kind regards,

        Alvaro.

      2. Serhiy Onyshchenko

        Thanks for letting me know, Alvaro Jardon.

        Happy Exalating!

      CommentAdd your comment...