Created
October 12, 2023 14:44
-
-
Save Damecek/d4daa871f356c6dfdadcbafe598d28d9 to your computer and use it in GitHub Desktop.
Queries and returns url for the last created WI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Execute the SOQL query | |
| QUERY_RESULT=$(sf data query -o carvago-prod --query "SELECT Id FROM sf_devops__Work_Item__c ORDER BY CreatedDate DESC LIMIT 1" --result-format csv) | |
| # Get the record ID from the result. We select the second line (actual data) and then cut by ',' to get the ID. | |
| RECORD_ID=$(echo "$QUERY_RESULT" | awk 'NR==2' | cut -d',' -f2) | |
| # Form the URL | |
| URL="https://carvago.lightning.force.com/sf_devops/DevOpsCenter.app?workItemId=$RECORD_ID" | |
| echo $URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment