https://prefect.io logo
Title
j

Jen Evenson

02/23/2023, 10:27 PM
@Marvin Is there a new jira integration for Prefect2?
s

Stéphan Taljaard

02/24/2023, 4:09 PM
Hi Jen. Looking at the Collections Catalog, it does not seem that the Jira has been ported from the Prefect 1 task library to Prefect 2's collections However, it should be relatively easy to create a custom task containing the old code almost unchanged. You could use a Secret block instead of the toml file
j

Jen Evenson

02/24/2023, 4:20 PM
Thanks. We did create our own Jira task, but the new Secret block doesn't read from a config file or env variable. We were hoping to not have to write our own task to do that, but it looks like we will.
s

Stéphan Taljaard

02/24/2023, 4:20 PM
I presume you prefer to not save the secret value itself inside the secret block?
j

Jen Evenson

02/24/2023, 4:22 PM
To set it in code, we'd have to commit it to git, so yeah, we're not doing that. And setting it in the UI looks like a manual process, which we're not interested in.
Orrrr maybe we're just not understanding the new Secret blocks. We are usually underwhelmed by the Prefect docs. Love the product, but man it's not easy to use. (Our workflows are complicated, so the tutorials are usually completely unhelpful.)
Also, thanks for taking the time to respond, even though it looks like you don't work for Prefect.
n

Nate

02/24/2023, 4:32 PM
hi @Jen Evenson - you don’t have to hard code / commit secrets to version control to save them in a secret block programmatically. you can do something like
from prefect.blocks.system import Secret

my_new_secret = Secret(value=“secret”)
my_new_secret.save(“my-new-secret”)

#so now you have a secret block saved on your workspace
assert Secret.load(“my-new-secret”).get() == “secret”
Is there a new jira integration for Prefect2?
what functionality would you like to see from a jira collection? we can work on adding a jira collection at some point
j

Jen Evenson

02/24/2023, 4:45 PM
Thanks, @Nate. The issue is getting
"secret"
to stuff into this bit:
my_new_secret = Secret(value="secret")
For Prefect 1, we were retrieving all the tokens we need from Vault when building the Prefect Docker image and setting env variables/writing to a config.toml file (I forget which we did as I didn't work on that piece) in that image - which gets deployed to our own self-hosted Prefect Cloud in k8s. The jira task then just grabbed the token it needed using the old Secret class. This also allowed each developer to set the tokens needed locally and test locally rather than having to build a new image and push to our Prefect Cloud every 5 minutes. I guess now each task that needs something from Vault will have to get it itself. We wanted to be lazy and keep getting tokens out of Vault the same way. 🙂
RE a jira collection -- We create jira tickets when certain things go wrong. (We aren't updating or closing tickets from our flows.) We already have a custom jira task because your v1 jira_task required the assignee to have a "name" property and our implementation doesn't have that. (We apparently have the largest standalone implementation of jira and it's highly customized by an internal team.) We were hoping you had a v2 jira task that would work for us so we have less code to maintain. Again, wanting to be lazy and reduce our codebase.