Hi All,
I am trying to comment on the issue via the Rest API. That comment should add the content related to the CI Job Info from GitLab. But if I am trying as a string it's working fine. But if I am trying to comment via the ${CI_JOB_STAGE} but its just printing the same. And also if I am trying the echo I can see the result of the Job Stage as expected but the comment is not printing correctly. Please find the below shell script which I have worked.
curl -D- -u xxxxxx:xxxxx -X POST --data '{"body": "$CI_JOB_NAME"}' -H "Content-Type: application/json" https://xxxxxxx.atlassian.net/rest/api/2/issue/xx-6/comment
Kindly help us how can I acheive this
Dear @Dileep Kumar Mone ,
the CI_JOB_STAGE seems to be a variable of your CI. Jira cannot resolve it. Make sure your CI uses the right variables. For testing you could replace the CURL command with
echo "${CI_JOB_STAGE}" > /path/to/file/test_comment.txt
and see if there is something written into.
So long
Thomas
Dear @Dileep Kumar Mone ,
was my answer useful? Then I would be happy when you click on the "green accept answer" button.
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.