Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Setting labels based on sub-tasks and sub-tasks of sub-tasks

Alex February 16, 2022

I'm using X-Ray.

I would like to apply a label (TC) to my stories when I create a Test Case for the story.

I would then like to remove the TC label and add a label of TE when I create a test execution against the test case.

 

I asked a few weeks ago about the first part of this, got an answer and have been using it but I don't know how to change the rule to now do what I want.

1 answer

1 accepted

0 votes
Answer accepted
Stefan Salzl
Community Champion
February 16, 2022

Hi @Alex ,

the easiest way would be to add the execution as a sub-execution of the story. In this case you could create the automation rule similar to the previous one:

  • when: issue is created
  • condition: issue type equals sub test execution
  • branch: for parent
  • action: edit issue, field lable, set value "TE"

 

image.png

 

Just an additional (kinda organizational) input:

for increasing awareness of your topic and as this refers to xray as well as automation: add those tags (xray, automation) to your question ;)

Please let me know if this helps.

 

Best
Stefan

Alex February 21, 2022

Tried to set up an automation set up as you specified but after creating a test execution the label wasn't added to the original ticket.

Stefan Salzl
Community Champion
February 21, 2022

Hi @Alex ,

Could you send a screenshot of the audit log output?

Did you create a test execution or sub test execution?

 

Best
Stefan

Stefan Salzl
Community Champion
February 21, 2022

My tests went OK. I tested like follows:

  • given - a User Story with test cases inside
  • when - I generate a sub test execution within the story by clicking "Execute - with Sub Test Execution" in the Test Coverage area of the story
  • then - Sub Test Execution is created as subtask of the story
    • and - Label of story (parent of the Sub Test Execution) is set to TE

(see screenshots)

 

given
image.png

 

when
image.png

then
image.png

audit log output
image.png

Alex February 21, 2022

So, I've just recently started working with x-ray so I might be using it incorrectly.

What I do is.

  1. Open the ticket I'm testing.
  2. Scroll to the test coverage section.
  3. Click on the add tests dropdown and usually select new test.
  4. I then open the test case that was created and add in the test steps.
  5. Then while still in the test case I select test runs from the 5 buttons in the test details section.
  6. Then I click on the execute in dropdown and select new test execution

I don't know where to find the audit log.

Stefan Salzl
Community Champion
February 21, 2022

OK. I see. There is not really a "correct or incorrect" ;) If it fits the process of the company/team and does what it should it´s correct :)

 

Sooo....here comes my (personal) suggestion that turned out as good practice several times in the past:

  • open a ticket that´s under test (for easier reference let´s call this "Story A")
  • creating the test case as described in your post
  • THEN: changing back to the Story A, section "Test Coverage"
  • click execute & choose "with sub test execution"
    • the advantage I see in this procedure is that the sub test execution is automatically creating test runs for all the test cases in the story A (could be that there are more than 1 testcases) whereas if you create the test execution out of the test case issue it only creates the test execution for this single test case
    • furthermore the sub test execution is automatically a subtask of Story A (the ticket under test). That increases traceablity (direct parent/child relation) and makes it easy to react on within automation rules

audit log

if you are in your automation rule screen there is "audit log" in the left upper corner (right below the rule details). If clicked the view on the right side will show audit details (different activations of the rule). By clicking on "show more" in of the activations even more details are shown (eg. what was processed within the rule) --> see screenshot

image.png

Alex February 22, 2022

Ah, right.

 

The way you're using it makes sense. I'll try doing it that way.

 

Thanks.

Like Stefan Salzl likes this
Stefan Salzl
Community Champion
February 22, 2022

You are welcome. Let´s give it a shot. 

In case this works for you please consider to accept the answer in order to have this case marked as solved ;)

Best
Stefan

Alex February 22, 2022

I've followed the steps suggested above for creating test executions from a test case but the automation doesn't seem to be triggering and assigning the label.2022-02-22_14-45.png

Stefan Salzl
Community Champion
February 22, 2022

Did you create the sub test execution out of the story (as described in my previous) or out of the testcase (you just wrote from test case)?

THEN: changing back to the Story A, section "Test Coverage"

click execute & choose "with sub test execution"

 

Could you please show a screenshot of your automation rule? And if possible of how and where you created which test execution (everything that would help analyzing)

Alex February 22, 2022

I think I know what I did wrong, I think I selected `with Test Execution` and not `with Sub-Test Execution`

Although for some reason when I selected sub-test execution two were made.

 

2022-02-22_16-57.png

Like Stefan Salzl likes this
Stefan Salzl
Community Champion
February 22, 2022

Is this behaviour reproducable? Did you try this again and it happens all the time? if so please document step by step.

Could you please also provide screenshot from your automation rule?

 

Best

Stefab

Alex February 22, 2022

I've just tried it another three times and each time two sub-test executions were created.

Steps I performed:

  1. Opened the task to test.
  2. Scroll down to the test coverage section.
  3. As there are no tests I click on the blue add tests dropdown and click new test.
  4. I open the test in a new tab.
  5. Add some test steps.
  6. I go back to the task I was testing.
  7. I clicked the execute dropdown and select with Sub-Test Execution.
  8. I didn't change any details on the modal that opened, I just clicked create.
  9. When I go back to the task I was testing I see two sub-test executions. In the screenshot below I actually went through steps 7 and 8 twice which is why there are 4 listed)

2022-02-22_22-06.png2022-02-22_22-07.png

Stefan Salzl
Community Champion
February 22, 2022

oooooff.....haven‘t ever experienced that one :o that sounds strange.

I know it‘s already been a long way but would i be possible to send a screenshot of the task issue you are testing as well as the test case?

btw:
does at least the automation works as expected? =)

Alex February 23, 2022

The automation works. 

616 is the task and 773 is the test.

The images are quite large, I'm not sure if they will work well on here. I may need to upload them somewhere else and post a link to them.

-PLAT-616-FE-Add-Image-Upload-to-Add-Upsell-Modal-Jira.png-PLAT-773-Test-FE-Add-Image-Upload-to-Add-Upsell-Modal-Jira.png

Stefan Salzl
Community Champion
February 23, 2022

I can´t really explain this behaviour. 1 thing i could suggest is to open the 2 test executions, open the history (at the very bottom) and take a look if the creator is the same in both issues or if there has been triggered any "hidden" automation.

In case the behaviour keeps as it is I recommend to contact xray support team.

Alex February 23, 2022

Both of the executions appear to have been created by me.

 

I'll contact x-ray support I guess,

Like Stefan Salzl likes this
Stefan Salzl
Community Champion
February 23, 2022

As (i guess) your initial question was answered would you please consider to accept the answer in order to mark this case as solved and make it easier for other users in need of help to find soltuions?

Thanks in advance.

Best
Stefan

Alex February 23, 2022

@Stefan Salzl just to make you (and anyone else reading this I guess) that the x-ray devs are aware of this issue and are working to fix it.

Not sure why it's not happening for you though?

Stefan Salzl
Community Champion
February 23, 2022

@Alex 

Holy crap!!! I´m so sorry.....it DOES happen on my site too. I just wasn´t aware of it :o :o

Thanks for letting me know. Really much appreciate this.

Best
Stefan

Suggest an answer

Log in or Sign up to answer