You need to make another API call to find the list of MRs related to the issue.
For your second question, if you are writing something to run from inside your
.gitlab-ci.yml file, if a job has an environment configured, the URL should be in the predefined variable
If you are trying to find the environment from the API, outside the pipeline itself, then I’m not so sure, but I think you need to do this:
- Get the MR from the API, there is some pipeline information in the JSON responses
- Using the pipeline ID from the previous step, use the jobs API to get all jobs from the pipeline
- Iterate over the jobs, and see if one of them has an environment, in which case you need its ID
- Then use the environment API to find the URL of the environment with the ID from the previous step (see
I haven’t tried this, so I may have missed something somewhere, but hopefully that gives you a starting point.