Need some help with setting up behavior to default the Project and Issue Type values on the Create Issue screen.
Condition : On the Xray Execute Test Screen, when the user clicks the Create Defect a Create Issue Dialog Screen is shown.
Expectation:
Hi Krishnanand
The execution page where you click the "create defect" button is an XRAY specific page which you can see from the URL
e.g.
http://localhost:8080/jira/secure/XrayExecuteTest!default.jspa?testExecIssueKey=XRAYT-2&testIssueKey=XRAYT-3
Scriptrunner does not load behaviours on the "XrayExecuteTest" page where you click the "Create Defect" button.
The browsers developer console log will show a message saying that
[SR Behaviours] Behaviours not applicable to the current form/screen
However, when you click the "Create Defect" button it opens a create defect (create issue) form which does load the behaviours.
You may be able to use the API methods described here to control the form based on the link that was used to open the create defect (create issue) form:
getBehaviourContextId()
Gets the ID of the web item that was clicked
getContextIssueId()
Gets the ID of the issue that was on the screen when the item was clicked.
However, currently there is a bug with those 2 methods which you can watch here to be notified when it is fixed
When this bug is fixed I suggest trying the methods above to get the link name and use that to control the Project and Issue Type available to the create defect (create issue) form.
Alternatively, you could use custom Javascript to modify the Link HTML tag of the button and append the ProjectId and IssueTypeId to the url:
e.g. change:
http://localhost:8080/secure/CreateIssue!default.jspa?issuetype=&decorator=none
to
http://localhost:8080/secure/CreateIssue!default.jspa?pid=10000&issuetype=10004&decorator=none
pid is the Numerical ID of your project
issueType is Numerical ID of your Issue Type
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.