The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Table Transformer: How to use js functions that expect a callback function as parameter?

Stephan Bauer
Contributor
March 31, 2023

For example the ->map() function of arrays expects a function as parameter which is then executed on every item of the array.

How do I pass this function when calling from within the table fransformer plugin?

So I want do something like this:

SELECT *,
       T1.Sprint->split(" ")->map(->match(("[0-9][0-9].[1-5].([1-6]|IP)")->0)
FROM T1

Any ideas?

P.S. Markup for an example table

||Key||Sprint||
|MC20-2943|MC20-23.2.1 (Feb 26) MC20-23.2.2 (Mar 12) MC20-23.2.3 (Mar 26) MC20-23.2.4 (Apr 09)|

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

3 votes
Answer accepted
Katerina Rudkovskaya _Stiltsoft_
Atlassian Partner
March 31, 2023

Hi @Stephan Bauer,

I see that you have a similar question here, so please let’s move to that thread.

Stephan Bauer
Contributor
April 3, 2023

Yes, but no ;-)

The use case I picked is the same but the map function of arrays is just picked as an example here.

The underlying question, I would like to get an answer to, is the one stated in the tite:

How to use js functions that expect a callback function as parameter?

Since I ran into this already multiple times and did not get it working I am interested if this is possible or not.

Best regards,
Stephan

Katerina Rudkovskaya _Stiltsoft_
Atlassian Partner
April 3, 2023

Hi @Stephan Bauer,

Unfortunately, you can't use js functions that have arguments as functions either. This comes from the security side of the app.

Stephan Bauer
Contributor
April 3, 2023

OK, thanks for the clarification.

Like # people like this
TAGS
AUG Leaders

Atlassian Community Events