We have a business layer project where we track all design tasks for our Product Owners. The output of those Tasks will be 1 or more Stories in 1 or more system layer projects (one per code base). This is available only as an action in the PO project - we don't want it elsewhere
I had been creating a manual rule per code base project, which is limited to run in the PO's project, to create and link a Story ticket with some default text in the appropriate fields, assigned to them.
As we're starting to write stories for more code bases, the list or automations is growing, so I'd like to find a way to create a single rule that allowed the PO to input the project where they would like the Story created, but...
If I use the userinput smart variable from the prompt in the manual trigger step, the Create action can't find the Story issuetype. If I use a known project to set the issuetype, then put the smart variable into the Project field on the Create step, the rule won't save.
Is there a way to achieve the outcome we need - from the PO Task, a new linked Story in a code base project based on user input when running the rule?
Maybe a trick of cloning the Task, editing to clear the fields, link the tickets, move the clone to the desired project and change the issue type... but how to move projects in a rule without making the rule multi-project and thus available in other projects?
I recall a similar question from two weeks ago about dynamically selecting the project from a manual trigger's user inputs, and that did not work. What was tried was:
The workarounds were:
There are open suggestions to add "Move Issue" to both the REST API and to automation actions, such as these:
https://jira.atlassian.com/browse/AUTO-549
https://jira.atlassian.com/browse/JRACLOUD-61359
https://jira.atlassian.com/browse/JRACLOUD-70305
Kind regards,
Bill
To add to Bill's answer, other than If/Else (and web request), one other option is to create a lookupTable as mentioned by @Trudy Claspill in below link. Please review the below thread's solution as the other poster had similar requirement.
If this solves your ask please consider accepting solution as it benefits folks in the future. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Kalyan Sattaluri, While the lookup table is a nice option for a limited/known list of projects, we have many and they'll grow this year, so ideally I have a one-size-fits-all solution.
@Bill Sheboy - you got me thinking about the web request. I'm now thinking the logic could be:
The issue I'm having here is getting the response from the web request, to which end I assume I'm doing something wrong in the config that action, because the URL works fine in a browser, and I'm getting a 200 response, but the payload in the response seems to be empty. Can you see where I'm going wrong with the below?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Dave Furlani
Can you just hardcode: rest/api/3/project/DFXXSYS
In the same screen, expand "Validate your web request configuration", click Validate and after 200, expand payload and check if you are seeing response body in payload?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BTW, just FYI. your project ID will be accessible at {{webResponse.body.id}} , of course after you are able to see the response that is..lol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I get a 404 error, although the same URL works in the browser for me. See below
Funnily enough with the smart variable in the Web request URL, and no optional headers provided, the validation gives me a 200 response, making think it was going to work.
I notice you have Authorization = Basic in your config, although that makes no difference to the outcome for me when I set it, with or without also adding Content-Type = Application/JSON. Do you have any other optional headers in your step's config?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And I've worked out it was giving me a 200 error because the user input wasn't getting added to the end of the URL, because I has .toUpper() instead of .toUpperCase()
Now that I've fixed the web request so it is requesting a specific project as required, I'm getting a 404 error in the audit logs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Dave!
I believe that error can be returned when the rule actor does not have browse permissions for the project. Have you checked that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Dave Furlani
Based on what you have shared (that you were able to see the response in the browser) but REST call not giving you the response, issue is with the credentials you passing.
Are you base64 encoding your token as listed here - LINK.
You cannot directly use the API token from Jira, you have to follow the steps listed above:
I will briefly list the steps:
$Text = ‘emailID:token’
$Bytes = [System.Text.Encoding]::UTF8.GetBytes($Text)
$EncodedText = [Convert]::ToBase64String($Bytes)
$EncodedText
What you get as output from above is base64 encoded string which you need to use with Basic auth.
So in your header, you give Authorization: Basic <base64string>
Back in your automation rule, pass this value, Click Validate to confirm 200 response.
Hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That seems to have done the trick. Thanks. While the doco suggests the API does not need authentication, that seems to only be for the request without a project key. As @Bill Sheboy suggests, if there's a project key in the request, the API needs to be authenticated. That's why I was getting a 200 when the request had no key, and a 400 when it did.
Adding a key seems to have fixed this. Thanks @Bill Sheboy and @Kalyan Sattaluri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Talking to Atlassian and the A4J user's email address can't be used. Each site must create a service account user (licensed) if they don't want to tie Auth keys to a human user
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For anyone wanting to create a similar rule, here's the logic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can I just confirm the need?
Is it that you only want the "manual trigger" to be activated from one Project, but create issues in multiple Projects as an outcome?
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ideally, yes
The existing rules I have are single project rules that only appear in the PO project, but create tickets in the system layer projects. I'm hoping to replace the growing list of those rules with a single rule
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.