Hey all, when using pactflow i've created a team u...
# pactflow
n
Hey all, when using pactflow i've created a team using the dashboard. But how can I assign pacts via the javascript package to automatically be assigned a specific team? I've seen a few things online but did not get it to work. This is the version: "pact-foundation/pact": "^9.18.1".
t
According to this, https://docs.pactflow.io/docs/user-interface/settings/teams/ I think you just add the application to the team on that UI panel
☝️ 1
m
That’s right. I believe there is a feature request somewhere where you can specify the team on publish, but I seemed to have misplaced it. I will dig it up or create a new one
This isn’t always obvious though at the point of publishing
The simplest option, is to pre-create all applications and teams, and do the assignments at that time. e.g. using something like https://github.com/pactflow/terraform-provider-pact
We’ll also be publishing our APIs later in Q2 (possibly early Q3) so you could build around that also
n
Oh I see okay so I need to do it through the actual UI and support for doing it programmatically may come in the future. Thank you both! 🙌
👍 1
m
That’s right
I’d like to see it in our CLI tools also, but I don’t see it being part of our JS (or any other client languages) any time soon, if I’m honest
t
You could support this server side with no changes to tools, if you treated provider names that deserialised to an object differently at the pactflow end:
Copy code
provider: JSON.stringify({ "team": "MyTeam", providerName: "MyProvider" })
or something
Or had a special tag, like
pactflow:team:MyTeam
or something
I don’t know if this is a good idea. But it’s an idea
💡 1
😅 1
👍 1
m
It sure is!