microsoft/azure-pipelines-extensions

Adding date to service now

stumueller opened this issue · 0 comments

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