2
1
0

I have couple of questions. 


I was able to get the Brand solution working, I just had to adjust the last line of code as brand_id was a double for some reason.

replica."brand_id" = brand_id.toFloat().toInteger().toString()

Would it be possible to add firstSync to Zendesk outgoing? Would only like to send brand_id of the first sync.

I only want it outgoing on first sync to avoid a call to be made on every synchronization, though I can live with this if not possible.


----------------------------------------------



replica.addedAttachments.collect

{it.internal = true; it}


worked wonderfully, attachments are only added as internal notes in Zendesk, thanks.

However, attachments added as internal notes in Jira are still sent to Zendesk and added as internal notes in Zendesk. I tried to update Jira outgoing as follows as I have with comments, but it did not have any effect. How can I only send attachments added in internal notes from Jira to Zendesk?

replica.attachments = issue.attachments.findAll{!it.internal)


-------------------------------------------------

For the following line of code where "Contact reasons" is a custom drop-down field.

issue.customFields."Contact reasons".value = "account_closure"

How can we set value for custom drop-down fields in Zendesk?

I would appreciate if the following questions are addressed. Thank you!

(Asked on behalf of the client)

    CommentAdd your comment...

    8 answers

    1.  
      3
      2
      1

      Hello, Account Management , might I ask you to replace the getPreviousJson function with this

      def getPreviousJson = {
          def ttRepo = (syncHelper).twinTraceRepository
          def await = { f -> scala.concurrent.Await$.MODULE$.result(f, scala.concurrent.duration.Duration.apply(1, java.util.concurrent.TimeUnit.MINUTES)) }
          def orNull = { opt -> opt.isEmpty() ? null : opt.get() }
          def ttOptFuture = ttRepo.getTwinTraceByLocalIssueKeyFuture(connection, issueKey)
          def ttOpt = await(ttOptFuture)
          def tt = orNull(ttOpt)
      //com.exalate.api.domain.twintrace.ITwinTrace tt = orNull(ttOpt)
          def lr = tt?.localReplica
          !lr ? null : ({
              def js = new groovy.json.JsonSlurper()
              def previousPayload = js.parseText(lr.payload)
              previousPayload.hubIssue
          })()
      }

      Please, let me know how it goes

        CommentAdd your comment...
      1.  
        2
        1
        0

        Hi Serhiy,


        Thanks for the workaround.


        I am getting the following error when trying to use the workaround.


        Please see screenshot attached.


        Please let us know how to fix this.


        Thanks,


        BR,

        Svein Tvedt

        No such property: twinTraceRepository for class: zendesknode.services.node.hubobjects.NodeHelper 


        1. Serhiy Onyshchenko

          Might I ask you to change the script a bit:


          def getPreviousJson = {
              def ttRepo = (syncHelper).twinTraceRepository
          //    com.exalate.persistence.twintrace.TwinTraceRepository ttRepo = ((com.exalate.replication.services.processor.SyncHelper)syncHelper).twinTraceRepository
              def tt = ttRepo.getTwinTraceByLocalIssueKey(connection, issueKey)
          //com.exalate.api.domain.twintrace.ITwinTrace tt = orNull(ttOpt)
              def lr = tt?.localReplica
              !lr ? null : ({
                  def js = new groovy.json.JsonSlurper()
                  def previousPayload = js.parseText(lr.payload)
                  previousPayload.hubIssue
              })()
          }
          
          def previousReplica = getPreviousJson()
          def firstSync = (previousReplica == null)
          

          Note, how nodeHelper.twinTraceRepository is replaced by (syncHelper).twinTraceRepository

        2. Account Management

          Thanks Serhiy Onyshchenko 


          I do not have that error anymore, now I have new error with the this workaround.


          The following line produced the following error as per screenshot attached. Checked line by line to find out that the issue is with this line. Can you please check it out?

          def tt = ttRepo.getTwinTraceByLocalIssueKey(connection, issueKey)


        3. Jillani Fazal

          Hi Account Management 

          It seems that the twintrace is missing for this local issue key; hence I would suggest you unexalate and then re-exalate to see if that makes any difference or not. Let me know the outcome. 


          BR, 
          Jillani

        4. Account Management

          Hi Jillani Fazal and Serhiy Onyshchenko ,


          Unexalate an reexalate did not make a difference.


          What do I need to do?


          Thanks,

          BR,
          Svein Tvedt

        5. Account Management

          Hi Support ,


          This function works perfectly, and now I am able to call Zendesk brand id on firstSync when it is the only time it is required.


          Thank you very much (smile)


          BR,

          Svein Tvedt

        6. Jillani Fazal

          Account Management 


          Sounds great and you are most welcome. (smile)

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

        bumping thread

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

          UPDATED on Aug 9th due to feedback: Zendesk - Brand
          Hello, Account Management ,

          Thanks a lot for asking this in community!
          I've got a work-around which may break in the future (since it relies on some private APIs) However the chances of this happening anytime soon are slim, since it has been working for the past 4 years:

          def getPreviousJson = {
              def ttRepo = (syncHelper).twinTraceRepository
          //    com.exalate.persistence.twintrace.TwinTraceRepository ttRepo = ((com.exalate.replication.services.processor.SyncHelper)nodeHelper).twinTraceRepository
              def tt = ttRepo.getTwinTraceByLocalIssueKey(connection, issueKey)
          //com.exalate.api.domain.twintrace.ITwinTrace tt = orNull(ttOpt)
              def lr = tt?.localReplica
              !lr ? null : ({
                  def js = new groovy.json.JsonSlurper()
                  def previousPayload = js.parseText(lr.payload)
                  previousPayload.hubIssue
              })()
          }
          
          def previousReplica = getPreviousJson()
          def firstSync = (previousReplica == null)
          

          Happy Exalating!

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

            Hi Account Management 

            Please try this in order to send the attachments in Zendesk as internal: 

            Attachment in internal Zendesk comment ?


            For setting a value, please check this: 

            How to fill a default value for custom field in Zendesk...?...   



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

              bumping thread

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

                bumping thread

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

                  bumping thread

                    CommentAdd your comment...