microsoft / azure-pipelines-extensions

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

Adding date to service now #1151

Closed stumueller closed 1 year ago

stumueller commented 1 year ago

Hi

I am trying to add the start date and end date to my servuice now change that is created. But I can;t figure out what format it should be in.

variables:
          - name: startTime
            value: $[ format('{0:yyyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}:{0:ss}Z', pipeline.startTime) ]
- task: UpdateServiceNowChangeRequest@2
            name: 'addStartTime'
            inputs:
              ServiceNowConnection: 'ServiceNow4'
              ChangeRequestNumber: $(changeReqNum)
              UpdateStatus: false
              WorkNotes: 'Adding Start Time'
              otherParameters: |
                {
                  "u_actual_start_date": "$(startTime)"
                }
            displayName: "Add Start Time"
variables:
          - name: endTime
            value: $[ format('{0:dd}/{0:MM}/{0:yyyy} {0:HH}:{0:mm}:{0:ss}', pipeline.startTime) ]
- task: UpdateServiceNowChangeRequest@2
            name: 'addEndTime'
            inputs:
              ServiceNowConnection: 'ServiceNow4'
              ChangeRequestNumber: $(changeReqNum)
              UpdateStatus: false
              WorkNotes: 'Adding End Time'
              otherParameters: |
                {
                  "u_actual_end_date": "$(endTime)"
                }
            displayName: "Add End Time"

Neither of these formats seem to work