microsoft / azure-pipelines-extensions

Collection of all RM and deployment extensions
http://www.visualstudio.com/explore/release-management-vs
MIT License
277 stars 422 forks source link

ServiceNow - Release Pipeline Schedule Start Date #998

Open mjthompson2107 opened 2 years ago

mjthompson2107 commented 2 years ago

Hi

I've tried passing a value for the Schedule Start Date field using the CreateChange ServerGate in a predeployment gate, but I cannot get a valid output. These are the following values that I have tried:

11-05-2021 12:00:10 UTC - not valid 05-11-2021 12:15:10 UTC - not valid 2021-11-05T07:56:59Z - yields the wrong date - 14-05-0011 13:48:59 05-11-2021T14:10:59Z - not valid date 05-2021-11T07:56:59Z - yields the wrong date - 10-11-0016 14:00:59 2021-05-11T07:56:59Z - yields the wrong date - 10-11-0016 14:00:59 2021-05-11T14:07:59Z - yields 10-11-0016 14:07:59 05/11/2021T14:07:59Z - not valid 20211105T14:07:59Z not valid 2021/05/11T14:07:59Z - 0009-03-13 18:27:10 not valid 11-05-2021 12:00:10 yields 14-05-0011 12:00:10 2021-11-05 12:00:10 yields 14-05-0011 12:00:10 yyyy-MM-dd HH:mm:ssZ - 2021-11-05 12:00:10Z yields 14-05-0011 12:00:10 05/11/2021 12:00:10 yields 10-11-0016 12:00:10 yyyyMMddhhmmss - 20211105120010 not valid

Please could someone advise - I have found this code in task.json and not sure how it works:

{toDateTimeFormat '$(schedulestarttime)' 'dd-MM-yyyy HH:mm:ss UTC'

Mikebeem commented 2 years ago

For me the following formats do work: 2021-11-17 18:00:00 2021-11-17 18:00:00+00:00

This variable is also working for me (when using the Approvals and Checks for an environment with multistage YAML): $(system.checksStartTime)

mike-thompson-h commented 2 years ago

@Mikebeem This didn't seem to work for me, as it yields the incorrect result. I've noticed in the extension code that the way the date is treated changed between v1 and v2. It works if I call the API directly via Postman

jai-ks commented 3 months ago

Any solution to this issue. I also having issue passing start and endtime to ServiceNow whicle creating a RFC.