github-for-jira icon indicating copy to clipboard operation
github-for-jira copied to clipboard

how to access Github Actions workflow data via smart values?

Open bboles opened this issue 3 years ago • 4 comments

I am able to see workflow results from Github Actions in Jira: image How do I access the info here via smart values? In particular, I am trying to access the build number. I have followed the directions for finding the smart value for a field and can see the custom field that has only some of the info:

    "customfield_10000": "{pullrequest={dataType=pullrequest, state=MERGED, stateCount=7}, build={count=2, dataType=build, failedBuildCount=1, successfulBuildCount=1, unknownBuildCount=0}, json={\"cachedValue\":{\"errors\":[],\"summary\":{\"pullrequest\":{\"overall\":{\"count\":7,\"lastUpdated\":\"2022-02-03T16:34:33.000-0800\",\"stateCount\":7,\"state\":\"MERGED\",\"dataType\":\"pullrequest\",\"open\":false},\"byInstanceType\":{\"GitHub\":{\"count\":7,\"name\":\"GitHub\"}}},\"build\":{\"overall\":{\"count\":2,\"lastUpdated\":null,\"failedBuildCount\":1,\"successfulBuildCount\":1,\"unknownBuildCount\":0,\"dataType\":\"build\"},\"byInstanceType\":{\"cloud-providers\":{\"count\":2,\"name\":\"Other providers\"}}}}},\"isStale\":true}}",

I also logged the values of {{build.name}}, {{build.url}}, {{build.state}} and {{build.refs}} in the audit log but I don't get anything helpful: image Any help would be appreciated. Thank you!

bboles avatar Feb 07 '22 20:02 bboles

Hm, I've looked into the smart values being returned and there seems to be quite a few things missing there for the dev panel. I'll ask the appropriate team to see what's going on.

mboudreau avatar Feb 25 '22 06:02 mboudreau

Thanks for raising the issue @bboles ! It looks like the build number is not one of the smart values supported at the moment. However, from the docs it looks like the name may be a concatenation of pipeline name # build number, is that the case for the data you see?

We'll forward your request to the team owning Automations for validation to see if they're aware of it. This issue is unlikely to be related to the GitHub integration itself.

ccrolf avatar Feb 27 '22 22:02 ccrolf

If I could get {{build.name}} to work, that would be sufficient but as I mentioned in my initial comment I am getting no data returned.

bboles avatar Feb 28 '22 19:02 bboles

I’d really love to have access to the build number too (or in GitHub actions terminology, the run_number). As shown above, despite the example in the docs, the build_name does not actually include the build number.

wasnotrice avatar Nov 11 '23 14:11 wasnotrice