ConfiForms WebServices Dropdown that reduces the values of picked values

Noah Leu December 29, 2022

Hello @Alex Medved _ConfiForms_ ,

this request is regarding this question.

I've tried to do this for a WebService dropdown. The WS is fetching all Jira groups. If a entry with a group is created. The option/group should be removed from the WS dropdown. 

Ive tried to replace the key of the WS for the ID and the number field with my group field. It did not work as expected. I am expecting something like this:

!name:entry1 AND !name:entry2 AND !name:entry3

Could you support me here? See my code below.



<ac:structured-macro ac:macro-id="333cdace-d31b-4984-9a5e-b38ae3de909d" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="formName">grouplist</ac:parameter>
<ac:parameter ac:name="type">Embedded</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="c6252c79-0145-4530-bdb8-5af08bcd5479" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">grouplist</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="bc86faa6-8f96-4abb-836f-18425ad9e2fe" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="mapping">groups|name|name</ac:parameter>
<ac:parameter ac:name="fieldName">group</ac:parameter>
<ac:parameter ac:name="fieldLabel">Group Name</ac:parameter>
<ac:parameter ac:name="values">/rest/api/2/groups/picker?maxResults=10000</ac:parameter>
<ac:parameter ac:name="extras">89f846f264788bfaf58c4efbf05de4eb</ac:parameter>
<ac:parameter ac:name="type">wsselect</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="a60e7be3-190a-4daa-bb40-1d5fcea5153d" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="fieldName">group</ac:parameter>
<ac:parameter ac:name="values">!name:[entry.group.queryAndSet(grouplist:@self;*;group.append(,)).split(,).join( AND !name:)]</ac:parameter>
<ac:parameter ac:name="action">Apply Filter on a field</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>

 

1 answer

0 votes
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 29, 2022

Hi

What is not working for you with this approach?

Just tried it myself...

http://recordit.co/6SQD2kU3gU

Works just fine

The only place I would maybe improve is the filter to work even if "group" field is unset/has no value

!name:[entry._func.queryAndSet(grouplist:@self;*;group.append(,)).split(,).join( AND !name:)]

Alex

Noah Leu December 30, 2022

Hey @Alex Medved _ConfiForms_ ,

thanks once again for the quick reply and I am pleased that it is working for you. 

I have updated the Filter and have the same configuration as above. For security reasons I will only look at an excerpt of our groups.  My problem is that the option is not correctly removed on my side if I add them to an entry.. 

 

image.png
Here are some more background information:

We are fetching around 2000 groups which may causes the problem. Additionally we are using version 2.27.11. 

To get only the excerpt of some groups I adjusted the filter to this:
name:x* AND !name:[entry._func.queryAndSet(grouplist:@self;*;group.append(,)).split(,).join( AND !name:)]

If the problem persists, do you have any other smart solution on how to reduce the options based on the existing entries?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events