Open link in a new tab

Content

Expand project menu

API to create work package worked on v8.3 but not on v10.3.1

Following powershell snippet works fine on v8.3 but not on v10.3.1:

            try {

               $CRdata = '

               {

                   "_type":  "WorkPackage",

                   "subject": "' + $title_CR + '",

                   "lockVersion": "0",

                   "status":{"href":"' + $api + 'statuses/' + $CRStatus + '"},

                   '+$CHANGEID_customField+'-' + $suffix.ToString($mask) + '"'+',

                   '+$CATGEORY_customField+',

                   "description":  {

                                       "format":  "textile",

                                       "raw":  "' + $description_CR +'"

                                   },

                   "_links":  {

                       "type": {"href":"' + $changeRequestWorkPackageType._links.self.href + '"}

                       }

               }

               '

               $wp = $null

               $wp = Call-API-OP -api_uri $apiAction.href -method $apiAction.method -payload $CRdata