erutanOccasional ContributorJoined 3 years ago8 ย Posts3 LikesLikes received1 ย SolutionView All Badges
ContributionsMost RecentMost LikesSolutionsRe: update tesetcycle issuelink via api Good luck! wish I could be more of assistance... If you do get an answer, it would be great to update this discussion and mark your comment as the answer... ๐ Re: update tesetcycle issuelink via api Sure... Well if you are using Server and not Cloud, maybe it would be best to contact official support, as v1 doesn't seem to include create issue link for testCycles Re: update tesetcycle issuelink via api Hi Austin-Hsieh , Are you using Zephyr Scale Cloud or Server? The link you provided is relevant to Server, and for Cloud there's API v2 which supports what you're looking for - https://support.smartbear.com/zephyr-scale-cloud/api-docs/#section/Introduction Maybe they have a v2 for Server version but didn't update the website yet? [Zephyr Scale cloud API] Is there a way to get TestCase ID using testcase name? Using gradle+JUnit I have automation that is running and uploading junit xml results to Zephyr. If a test does not exist it's automatically created. I added a code (in the @BeforeEach setUp() function) that collects the "@Issue" annotations of the test methods and builds a map of "method name":"issueKey". I need to find a way to get the ID of the testcase that was created (or an existing one) based on the testcase name (which is the method name), so after uploading the results I will be able to use the Create Issue Link API to add coverage, by linking the tests to corresponding issues. So far, I know of the TestCases API: https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/listTestCases But it lets me get all testcases in a project/folder, or get a specific testcase by its testCaseKey, and for new tests created on-the-fly I don't have their key. Any chance someone already found a solution? Re: Junit5 + Zephyr Scale + Gradle project integration Hi AlexGnu As per this Open issue: https://github.com/gradle/gradle/issues/1330 Gradle does not support JUnit listeners, so you cannot use this method with gradle. However in my project I was able to workaround that, using the created JUnit XML reports during build, and upload them to Zephyr using the JUnit XML API in an <Exec> type gradle task to run a command line running a py script. This py script uploads multiple XML files to Zephyr, editing them so that when the test cases are automatically created (if they don't exist) their name will include just the test method name, without the full package and class names, making it more readable in Zephyr. Just change the script locally to point to the right xml files folder. The script can be found here: https://gist.github.com/yyahav/c5f7791bd3bb9ec9148ebbdf9aeb5914/raw/57547823a565b45cf7a137e5531cabb0... You probably already have an API token, if not you need to create one. Create here: https://support.smartbear.com/zephyr-scale-cloud/docs/rest-api/generating-api-access-tokens.html The token should be passed as a '--token <tokenId>' to the script. Re: How can I update test results using API to a specific cycle phase? (Pytest) Hi gqdabien , You can create Junit XML reports using this method: https://docs.pytest.org/en/latest/how-to/output.html#creating-junitxml-format-files Then use Zephyr test executions - upload JUnit XML API https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automations/operation/createJUnitExecutions I created a py script that uploads multiple XML files to Zephyr, after editing them in such a way that when the test cases are automatically created (if they don't exist) their name will include just the test method name, without the full package and class names, making it more readable in Zephyr. Just change the script locally to point to the right xml files folder. The script can be found here: https://gist.github.com/yyahav/c5f7791bd3bb9ec9148ebbdf9aeb5914/raw/57547823a565b45cf7a137e5531cabb073d0673c/zephyrUpload.py You will need to create an API token so you can use it. Create one here: https://support.smartbear.com/zephyr-scale-cloud/docs/rest-api/generating-api-access-tokens.html The token should be passed as a '--token <tokenId>' to the script. Re: Test Cases API - How to add a link to an issue on a different project? As no one from the community answered this, I thought it's best to add the official Support answer: Zephyr Scales REST API uses the JIRA IDs and does not accept the keys. One can make use of Atlassian's Cloud REST API to obtain the IDs by using Jira keys. See the following documentation https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get Then it's possible to use the Create issue links endpoint to create a link between a test case and a Jira issue of any project. See screenshot for example. So basically a script is needed if anyone wants to automate this, get IDs out of the issue key, then use the Create Issue Link endpoint to create the link between the test and the issue. Test Cases API - How to add a link to an issue on a different project? Iโm using the test cases endpoint API to create test cases, and I would like to link the test cases to issues that are on a different project. How can I do that? While path parameters include testCaseKey which has the project id in the test case key - PRJ-T123, the body parameters include only issueId which is integer. I canโt use the full issue key which includes project, e.g. PRJ2-1234, and I can't find the issue ID in an issue details page. From docs : Create issue link Creates a link between a test case and a Jira issue. AUTHORIZATIONS: AccessToken PATH PARAMETERS testCaseKey - required - string(.+-T[0-9]+) - The key of the test case. Test case keys are of the format [A-Z]+-T[0-9]+ REQUEST BODY SCHEMA: application/json Issue Link Input issueId - required - integer <int64> >= 1 - The issue ID Solved