Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Confluence
Teams
, (opens new window)

Requirement Yogi (Data Center)
Results will update as you type.
  • Getting Started - Tutorials
  • Administrator's guide
  • Features
  • Requirement Yogi for Jira
  • RY Testing and Compliance
  • Integrations
    • Zephyr integration with Requirement Yogi
    • Xray integration with Requirement Yogi
    • Comala integration
    • Scripting
    • ReqIF integration
    • PSEA: Export add-on
    • Scaffolding
  • APIs
  • Release notes
  • Archives (Legacy Features)
    Calendars
You‘re viewing this with anonymous access, so some content might be blocked.
/
Scripting
Updated Apr 04, 2023

    Scripting

    We are often asked whether it is possible to script the creation of requirements.

    Accessing the Jira issue through the REST API

    It is possible to access the details of a Jira issue using:

    {baseUrl}/rest/api/latest/issue/{issueKey}

    For example, assuming the Jira issue is http://jira.local:2990/jira/browse/SCRUM-10, then the REST API is http://jira.local:2990/jira/rest/api/latest/issue/SCRUM-10.

    It is also possible to write into the same URL. For example, go to a Jira issue, open the Javascript console and write the following code (after modifying the parameters) and it will set the requirements to FN-01:

    $.ajax({ type: "PUT", url: AJS.contextPath() + "/rest/api/2/issue/" + RY.getIssueKey(), // ID of the current issue data: JSON.stringify({ "fields": { // "summary": "New summary", "customfield_10300": [ // ID of the Requirement Yogi Custom Field { "applinkId": "f6c9112d-0dbf-3f28-9307-f30e55632e0c", "spaceKey": "TEAM", "key": "FN-01", "relationship": "implements", "baseline": null // Can be omitted } ] }, }), contentType: "application/json; charset=utf-8" });

    Confluence

    You can access the search results using {baseUrl}/rest/reqs/1/requirement2/{spaceKey}

    For example, assuming TEAM as a space key: http://confluence.local:1990/confluence/rest/reqs/1/requirement2/TEAM

    The full REST documentation (URL parameters, etc.) is provided on our developer portal.

    {"serverDuration": 28, "requestCorrelationId": "0c78b58cccf7439ea20cde09f865f65d"}