Highlighted
New Member.
694 views

Want to trigger "New defect" screen, once custom button clicked on the Reqs. module

Jump to solution

Hi,

 

I have created a custom button on  Reqs. module and want to trigger "new defect" screen once clicked. Could anyone take a look at the below code and suggest? Thanks.

 

If ActionName = "CreateDefect" Then
defect1=MsgBox("Do you want to Create a Defect?", vbYesNoCancel, "Yes or No or Cancel")
If defect1 = vbYes Then
Action("act_add_bug").Execute
elseif defect1= vbNo then

......
 End If
End If

 

 

Regards.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.. Absent Member..
Absent Member..

You can find out the names of actions being triggered from your interaction with the UI by adding this line

MsgBox(ActionName)

to the ActionCanExecute workflow subroutine.

 

Note that adding that line of code will trigger pop-ups for every action executed, for every interaction with the UI, for every user, so you may want to put it into a project nobody else is using or insert it during a time when no other users are on the system. Then remove it as soon as you have the information you need.

 

I also think that your syntax is incorrect for calling that action. Take a look at the "Action Object" section in the Administrators Guide in the chapter on Workflow Object and Property Reference.

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)

View solution in original post

5 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Is the code not working for you? Are you getting errors?

 

If you have "On error" statements in the subroutine where this code runs, you can comment those out to make the system show you any errors that are coming up.

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)
0 Likes
Highlighted
New Member.

Thanks for reply.

Yes, the code is not working for me and I am not getting any error either.

When I press the 'Yes' button on the msg box, nothing happens. I want that a New Defect window should pop up when I click on it.

Is the action name is correct to trigger the defect window?

 

Many Thanks.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

You can find out the names of actions being triggered from your interaction with the UI by adding this line

MsgBox(ActionName)

to the ActionCanExecute workflow subroutine.

 

Note that adding that line of code will trigger pop-ups for every action executed, for every interaction with the UI, for every user, so you may want to put it into a project nobody else is using or insert it during a time when no other users are on the system. Then remove it as soon as you have the information you need.

 

I also think that your syntax is incorrect for calling that action. Take a look at the "Action Object" section in the Administrators Guide in the chapter on Workflow Object and Property Reference.

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)

View solution in original post

Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

The Action you are calling is only available from the Defects module. Actions are module specific. And sometimes an Action is not even available in the same module, for example because it is only visible on a certain tab.

 

In this case there exists an Action in the Requirements module that will open the New Defect dialog, but that Action is called actAssNewDefect or Links.AddAndLinkDefect, and it is only available if you have the Linked Defects tab open.

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
Highlighted
Super Contributor.
Super Contributor.

@Jan Czajkowski :

I am trying to open new defect window from Test Execution view when user change status of Test Instance to Blocked.

Sub TestSetTests_FieldChange(FieldName)

If TestSetTest_Fields.Field("TC_STATUS").Value = "Blocked" then
'If Run_Fields.Field("RN_STATUS").Value = "Blocked" then
Dim answer3
answer3 = MsgBox("You have blocked a Test Instance. Do you want to create a New Defect", vbQuestion + vbYesNo + vbDefaultButton2, "Test Instance Blocked")
If answer3 = vbYes then
'msgbox "Your choise is:" & answer
Actions.Action("Links.AddAndLinkDefect").Execute

End If

End Sub

 

messages are displayed but the action is not getting triggered.

But in the same logic, I could open new defect screen if user Blocks a Test Step in Sub Step_AfterPost - Manual Runner module.

Can you please help if it will be possible to open new defect action (Links.AddAndLinkDefect) if user changes test instance status.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.