{"action":"created","issue":{"url":"https://api.github.com/repos/MicrosoftDocs/vsts-docs/issues/2751","repository_url":"https://api.github.com/repos/MicrosoftDocs/vsts-docs","labels_url":"https://api.github.com/repos/MicrosoftDocs/vsts-docs/issues/2751/labels{/name}","comments_url":"https://api.github.com/repos/MicrosoftDocs/vsts-docs/issues/2751/comments","events_url":"https://api.github.com/repos/MicrosoftDocs/vsts-docs/issues/2751/events","html_url":"https://github.com/MicrosoftDocs/vsts-docs/issues/2751","id":390452599,"node_id":"MDU6SXNzdWUzOTA0NTI1OTk=","number":2751,"title":"What is the expected value of Agent.JobName?","user":{"login":"lifesoccult","id":9664664,"node_id":"MDQ6VXNlcjk2NjQ2NjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/9664664?v=4","gravatar_id":"","url":"https://api.github.com/users/lifesoccult","html_url":"https://github.com/lifesoccult","followers_url":"https://api.github.com/users/lifesoccult/followers","following_url":"https://api.github.com/users/lifesoccult/following{/other_user}","gists_url":"https://api.github.com/users/lifesoccult/gists{/gist_id}","starred_url":"https://api.github.com/users/lifesoccult/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lifesoccult/subscriptions","organizations_url":"https://api.github.com/users/lifesoccult/orgs","repos_url":"https://api.github.com/users/lifesoccult/repos","events_url":"https://api.github.com/users/lifesoccult/events{/privacy}","received_events_url":"https://api.github.com/users/lifesoccult/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"vtbassmatt","id":714283,"node_id":"MDQ6VXNlcjcxNDI4Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/714283?v=4","gravatar_id":"","url":"https://api.github.com/users/vtbassmatt","html_url":"https://github.com/vtbassmatt","followers_url":"https://api.github.com/users/vtbassmatt/followers","following_url":"https://api.github.com/users/vtbassmatt/following{/other_user}","gists_url":"https://api.github.com/users/vtbassmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/vtbassmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtbassmatt/subscriptions","organizations_url":"https://api.github.com/users/vtbassmatt/orgs","repos_url":"https://api.github.com/users/vtbassmatt/repos","events_url":"https://api.github.com/users/vtbassmatt/events{/privacy}","received_events_url":"https://api.github.com/users/vtbassmatt/received_events","type":"User","site_admin":false},"assignees":[{"login":"vtbassmatt","id":714283,"node_id":"MDQ6VXNlcjcxNDI4Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/714283?v=4","gravatar_id":"","url":"https://api.github.com/users/vtbassmatt","html_url":"https://github.com/vtbassmatt","followers_url":"https://api.github.com/users/vtbassmatt/followers","following_url":"https://api.github.com/users/vtbassmatt/following{/other_user}","gists_url":"https://api.github.com/users/vtbassmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/vtbassmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtbassmatt/subscriptions","organizations_url":"https://api.github.com/users/vtbassmatt/orgs","repos_url":"https://api.github.com/users/vtbassmatt/repos","events_url":"https://api.github.com/users/vtbassmatt/events{/privacy}","received_events_url":"https://api.github.com/users/vtbassmatt/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-12-12T23:25:40Z","updated_at":"2018-12-13T13:34:15Z","closed_at":"2018-12-13T13:34:15Z","author_association":"NONE","body":"Currently when trying to use `Agent.JobName` (in bash, so `$AGENT_JOBNAME`) its value is just `Job`. I expected this to be the name of the Job/Phase, e.g. `Build` or `Build Job` as shown in the build pipeline UI. Here's the yaml and output where I'm trying to test it.\r\n\r\nYAML:\r\n```\r\njobs:\r\n  - job: Build\r\n    pool: 'Local macOS Pool'\r\n    steps:\r\n      - bash: |\r\n          ...\r\n          echo \"DEBUG: Agent.JobName is: ${AGENT_JOBNAME}\"\r\n          ...\r\n```\r\n\r\nOutput:\r\n```\r\n2018-12-12T22:28:06.3069500Z ==============================================================================\r\n2018-12-12T22:28:06.3069640Z Task         : Bash\r\n2018-12-12T22:28:06.3069690Z Description  : Run a Bash script on macOS, Linux, or Windows\r\n2018-12-12T22:28:06.3069730Z Version      : 3.142.2\r\n2018-12-12T22:28:06.3069830Z Author       : Microsoft Corporation\r\n2018-12-12T22:28:06.3069880Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613738)\r\n2018-12-12T22:28:06.3069970Z ==============================================================================\r\n2018-12-12T22:28:06.4757450Z Generating script.\r\n2018-12-12T22:28:06.4844430Z [command]/bin/bash --noprofile --norc /Users/dev1/workspace/_temp/74d89d8f-f8d0-487a-b88a-ec9f0fc50be5.sh\r\n...\r\n2018-12-12T22:28:06.5078660Z DEBUG: Agent.JobName is: Job\r\n...\r\n```\r\n\r\nI'm trying to use this value as a grouping ID in influx/grafana, and a value of `Job` clearly does not give enough definition for me to uniquely separate different jobs. To be clear, I expect this value to match the name of the job, which in this case is `Build`. If I am using the incorrect variable, please let me know.\r\n\r\n---\r\n#### Document Details\r\n\r\n⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*\r\n\r\n* ID: 9ffebdc8-521c-44b5-cde4-4abdc1bd6f18\r\n* Version Independent ID: dc0effda-6d93-62aa-64c5-4e6f283b0826\r\n* Content: [Predefined build variables - Azure Pipelines](https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=vsts)\r\n* Content Source: [docs/pipelines/build/variables.md](https://github.com/MicrosoftDocs/vsts-docs/blob/master/docs/pipelines/build/variables.md)\r\n* Product: **devops**\r\n* GitHub Login: @andyjlewis\r\n* Microsoft Alias: **alewis**"},"comment":{"url":"https://api.github.com/repos/MicrosoftDocs/vsts-docs/issues/comments/446969772","html_url":"https://github.com/MicrosoftDocs/vsts-docs/issues/2751#issuecomment-446969772","issue_url":"https://api.github.com/repos/MicrosoftDocs/vsts-docs/issues/2751","id":446969772,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Njk2OTc3Mg==","user":{"login":"vtbassmatt","id":714283,"node_id":"MDQ6VXNlcjcxNDI4Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/714283?v=4","gravatar_id":"","url":"https://api.github.com/users/vtbassmatt","html_url":"https://github.com/vtbassmatt","followers_url":"https://api.github.com/users/vtbassmatt/followers","following_url":"https://api.github.com/users/vtbassmatt/following{/other_user}","gists_url":"https://api.github.com/users/vtbassmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/vtbassmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtbassmatt/subscriptions","organizations_url":"https://api.github.com/users/vtbassmatt/orgs","repos_url":"https://api.github.com/users/vtbassmatt/repos","events_url":"https://api.github.com/users/vtbassmatt/events{/privacy}","received_events_url":"https://api.github.com/users/vtbassmatt/received_events","type":"User","site_admin":false},"created_at":"2018-12-13T13:34:15Z","updated_at":"2018-12-13T13:34:15Z","author_association":"COLLABORATOR","body":"This is a bug we're tracking in the product (1362323 for anyone with access to the internal bug db). As a workaround until it's fixed, you can specify the name in a variable and use it. Example:\r\n\r\n```yaml\r\njobs:\r\n- job: Build\r\n  steps:\r\n  - bash: echo $JOBNAME\r\n  - script: echo %JOBNAME%\r\n  variables:\r\n    JobName: Build\r\n```"}}
{"actor":{"display_login":"vtbassmatt"}}