cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Different results on web service call - run now vs. standartd run

I am using the call web service action to create a ticket within Jira (in case anyone else uses this system). I am using the SOAP api for Jira. I am able to create the ticket. When I run the web service from within the designer using the run now feature I also get a return result from Jira after the ticket is created with the Jira ticket information (e.g. ticket number, etc.). I have the action set to store the results within a workflow variable. When I actually run the workflow a ticket is created within Jira, but the workflow variable is blank. Why do I get different results when using the run now feature and when I run the actual workflow?

 

On a second note Jira is only moving forward with REST web service calls. Does anyone have experience using REST with Nintex Workflow 2013 and/or with Jira by Atlassian?

Labels: (1)
0 Kudos
Reply
9 Replies
Not applicable

Re: Different results on web service call - run now vs. standartd run

Any takers?

0 Kudos
Reply
mmatsako
Nintex Newbie

Re: Different results on web service call - run now vs. standartd run

Hello,

Do you have any examples of creating an issue in JIRA via Nintex workflow?   Either REST or SOAP examples would be highly appreciated.

Thanks!

Mike

0 Kudos
Reply
patrick_hosch
Nintex Newbie

Re: Different results on web service call - run now vs. standartd run

Lawrence Smith​, it might be the case that your XPath is pointing to the wrong node. there is a little bit of a difference between the results returned in Run Now and the ones when executing the web service on runtime.

The difference is there for ‘historic’ reasons. Originally, the action use to try and be ‘smart’ and pull out the results node from the SOAP envelope. Run Now just shows the entire response. This accounts for the difference between run now and run time. However, this behavior is basically only there for backwards compatibility.

If the user uses the more powerful ‘Specify elements’ functionality of ‘Call web service’, it will not have this incorrect behavior. It allows the user to use a picker to choose the element they need, rather than specify XPath manually.

Give that a try and let us know how you go.

0 Kudos
Reply
Not applicable

Re: Different results on web service call - run now vs. standartd run

Mike,

Ultimately I was able to get the process working with Jira via the SOAP call. I have not had time to start working on REST. For the SOAP call there are three primary steps that you need to do. First, you need to call, receive, and store the token that Jira will provide. Here is the XML that I use to get the token:

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="https://YOURJIRALOCATION/jira/rpc/soap/jirasoapservice-v2">

  <soap:Header>

  </soap:Header>

  <soap:Body>

    <m:login>

      <in0>SERVICE ACCOUNT USER NAME GOES HERE</in0>

      <in1>PASSWORD FOR SAID ACCOUNT</in1>

    </m:login>

  </soap:Body>

</soap:Envelope>

This will return a token that you will store and need to use to create the ticket. This ^^^ is what was causing me headaches for a long time because I didn't know I needed that token. I also use a run-if after this to verify the results and perform some error handling if something went wrong. The next thing I do is call the web service to create the ticket. The XML here is also pretty simple. Note, this is where the data that I get back is a bit wonky. I would love to be able to continue updating the ticket, but I haven't been able to get unique ID for the ticket.

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="https://YOURJIRALOCATION/jira/rpc/soap/jirasoapservice-v2">

  <soap:Header>

  </soap:Header>

  <soap:Body>

    <m:createIssue>

      <in0>{WorkflowVariable:Jira Token}</in0>

      <in1>

        <assignee>Username for who the ticket it going to be assigned to</assignee>

        <description>Main body of information for the ticket</description>

        <priority>Priority - but make sure that this maps correctly for your Jira type</priority>

        <project>Jira project name</project>

        <reporter>Username for the person who created the ticket</reporter>

        <summary>The ticket title</summary>

        <type>What type of ticket are you creating? This should be a number that you need to get within Jira</type>

        </in1>

    </m:createIssue>

  </soap:Body>

</soap:Envelope>

The third thing that I have to do is verify the username is correct. Jira kicks back to Nintex the error when the user doesn't exist. This is mainly due to how we administer this system that I don't have control over. I do a username check with a couple of variations, and if that doesn't work I then create the account via another web service call. I then resubmit the data above and it works out just fine.

In short I love Nintex overall and how easy it is to work with. I just wish other systems were as accommodating. Hope that helps.

0 Kudos
Reply
Not applicable

Re: Different results on web service call - run now vs. standartd run

What I have done is take the entire return message, place it in an email (that has become my method for seeing what truly comes back) and work from that. It is there that I discovered that the XML returned isn't really returning anything other than some blank data; however, the run now has the data that I am looking for.

0 Kudos
Reply
mmatsako
Nintex Newbie

Re: Different results on web service call - run now vs. standartd run

Hi Lawrence,

Thanks a bunch for posting this, its very insightful and helpful!

0 Kudos
Reply
cju
Nintex Newbie

Re: Different results on web service call - run now vs. standartd run

To correctly see the return message, have set the email body as Plain Text in the "send notification" action ?

0 Kudos
Reply
mmatsako
Nintex Newbie

Re: Different results on web service call - run now vs. standartd run

Another good way to test the data coming back would be to store the results in a list.   This can sometimes avoid some of those "plain text" complications, which is a really good suggestion by Caroline Jung for dealing with the blank results.

0 Kudos
Reply
Not applicable

Re: Different results on web service call - run now vs. standartd run

I have not done that. I will test that out and see what happens. Thank you. I will also try what Mike mentioned and see what happens when the data is placed in a list.

0 Kudos
Reply