1 2 3 Previous Next 37 Replies Latest reply on Jan 20, 2016 12:11 AM by user19752

    Help needed with CURL scripting (GET and authentication)

    SubSkip

      Title

      Help needed with CURL scripting (GET and authentication)

      Post

      I've exhausted my Google-fu skills trying to figure this out.

      Use case:

      FMP 13 application needs to send information into Jira to create a new issue. I can use the Send Event ( ) script step to open the CMD prompt and fire off the curl POST via the Jira API (https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-create-issue).

      
      cmd.exe /C curl -D- -X POST -H "Authorization: Basic username:password" --data 
      "{\"fields\":{\"project\":{\"key\":\"project\"},\"summary\":\"REST ye merry
       gentlemen.\",\"description\":\"Creating of an issue via REST API\",\"issuetype\":
      {\"name\":\"Documentation\"},\"customfield_10829\":{\"value\":\"Other\"}}}" 
      -H "Content-Type: application/json" http://project_URL/rest/api/2/issue/

       

      Problem #1

      Is there a way for me to pass in the username:password for the user who is currently logged in to the FMP app (uses external LDAP for authentication)? This way, the Jira issue will have the submitter as the owner, instead of a generic service account.

      Problem #2

      How can I get the results of that POST and enter it back into a FMP db field? The above POST will return the Key and URL for the newly created issue in Jira. I'm thinking something with Get(ScriptResult) step.

      Thanks for the help!

        1 2 3 Previous Next