Setting and getting labels - by another addon - in the same transition

Issue #518 resolved
Patrick Schuh [brainbits] created an issue

Hi Fidel,

I'm trying to combine your addon with the Checkbox-AddOn from Okapya (https://marketplace.atlassian.com/plugins/com.okapya.jira.checklist/server/overview).

The use case: a customer adds a request via Service Desk and defines a list of services he wants to order by checking multiple checkboxes within a checkbox list. This checkbox-list should be transferred into a customfield checkbox list so that the service desk agents has a kind of task checklist within that ticket. The Addon allows to add a condition on a transition so that we can check if all task are marked as done.

Therefor I need a dynamic task list that depends on the selection the user made in the checkbox list.

The Checklist-AddOn provides a post function that allows to edit a checklist-customfield with in a transition. That function provides a condition that checks if a specific label is added to the issue.

My approach is to use the workflow toolbox to parse for the checked checkboxes, set corresponding labels and set the checklist-items depending on that labels. After that I want to delete that "temporary labels". All that shouId happen in one single transition.

I build that and it - almost - worked. The only problem is, that the Checkbox-AddOn can not get the labels that are set within the same transition. The Okapya-Team replied the following:

Hi Patrick,
The add-on uses the standard JIRA API to retrieve the labels. I guess that during the transition, the label is not yet persisted to the database and is therefore not available when Checklist makes its request. A few ideas that come to my mind:
   Make sure that the labels are set in the transition before the Checklist custom action
   If not already the case, make the script adding the label its own action and make sure that it runs before the Checklist action
Hope that helps,
Regards,
Yves
Okapya Team

So, I'm wondering if there is any possibility to write the labels that way, that the AddOn can retrieve them from the API within the current transition?

Best regards Patrick

Comments (3)

  1. Fidel Castro Armario repo owner

    Please, attach a screenshot of the post-function's tab of the transition were you almost attained to implement the solution. I would like to see all the post-function's configurations and the execution order.

  2. Patrick Schuh [brainbits] reporter

    Hi Fidel,

    thank you for your help. I found an easy way to manage it via a Groovy Script.

  3. Log in to comment