JQL automation compare initiator with reporter

Arnar Símonarson
Contributor
October 12, 2022

Hello,

I am trying to test out automation that uses the condition of whether the the Initiator is in Request Participants OR if the Initiator is the Reporter

So one would think this would do the trick:

"Request participants" in ({{initiator.accountId}}) OR {{initiator.accountId}} = {{issue.reporter.accountId}}

The request participants part works fine but I can not find a way to make the reporter part work and I have tried every possible permutation I can think of, e.g.

{{initiator.accountId}} = {{issue.reporter.accountId}}

{{initiator}} = {{issue.reporter}}

{{initiator}} = reporter

{{initiator.emailAddress}} = {{issue.reporter.emailAddress}}

{{initiator.displayName}} = {{issue.reporter.displayName}}

and others I can't remember to list, and also tried with "is" instead of "="

Funnily enough, the AccountId and DisplayName and EmailAddress ones give the error with the correct comparison in text form in the audit but i guess the underlying data formats just doesn't allow the comparison?

 

No subsequent actions were performed since JQL condition did not pass due to error running JQL:
Invalid JQL: myaccountidstring = myaccountidstring
Does anyone know how to make this work?

1 answer

1 accepted

1 vote
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 12, 2022

Hi @Arnar Símonarson - Can you please share a screenshot of the rule?  It would help to have the additional context around the rule.

Arnar Símonarson
Contributor
October 13, 2022

Hi @Mark Segall ,

I am just testing Manual trigger -> JQL Condition (as it is descripted in the description)-> Create Comment for now

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 13, 2022

Ahh ok... So you're just looking for the query.  This should work:

"Request participants" in ({{initiator}}) OR Reporter = {{initiator}}
Like Arnar Símonarson likes this
Arnar Símonarson
Contributor
October 13, 2022

Thanks!, for some reason this works and not:

{{initiator}} = reporter

Not sure why

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 13, 2022

It's because of how JQL wants to see things.  If you're writing a JQL, you're not going to put "bob.smith" = Reporter.  You're going to go with Reporter = "bob.smith".  If you were doing an advanced compare condition, it would be indiscriminate of what comes first, but JQL needs to drive off of the field first then the result you're looking for.

Arnar Símonarson
Contributor
October 13, 2022

Yes i can see that. It's just confusing because of how the audit log reports the error, as if it's just comparing two simple strings yet somehow failing even though they look identical.

Arnar Símonarson
Contributor
October 13, 2022

@Mark Segall 

One more thing, if I wanted to add one more term into that JQL so it would functionally become:

"Request participants" in ({{initiator}}) OR Reporter = {{initiator}} OR {{initiator}} = specificHardcodedAccountId

 that is, add

OR {{initiator}} = specificHardcodedAccountId

at the end.

Since neither is a specific issue field - do you know how i would get that to work?

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 13, 2022

I'd need a better understanding of what you're trying to accomplish...

  • Are you trying to only execute this when the initiator is a specific user? In this case, you'll want to just change your query to something like this:
    • "Request participants" in (hardCodedID) OR Reporter = hardCodedID
  • Are you trying to do something different when the initiator is this specific user? For this you would use an IF/Else condition with an advanced condition after the rule triggers:
    • {{initiator}}
      Equals
      hardCodedID
Arnar Símonarson
Contributor
October 13, 2022

The end goal of this is automation that triggers when a comment is added to an issue.

If the issue is in specific statuses (On Hold, Waiting for customer, Resolved etc) and if the initiator of the comment is A) in Request Participants or B) the Reporter or C) the default actor in Email This Issue then the issue should be put into In Progress.

So preferably i would be able to keep the logic neat in one line:

"Request participants" in ({{initiator}}) OR Reporter = {{initiator}} OR {{initiator}} = specificHardcodedAccountId
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 13, 2022

So you'd need something like this then:

  • TRIGGER: Issue Commented
  • CONDITION: Status Contains
    • On Hold, Waiting for customer, Resolved
  • IF Condition (Or option selected)
    • Advanced Condition 1
      • Request Participants contains {{initiator}}
    • Advanced Condition 2
      • {{issue.reporter}} equals {{initiator}}
    • Advanced Condition 3
      • {{rule.actor}} equals {{initiator}}

Then add the transition issue action inside your If condition

Like # people like this
Arnar Símonarson
Contributor
October 13, 2022

I did have to use {{issue.Request Participants}} so my final result is the following. (Using AND instead of OR just for testing). Thanks for all your help!

advancedcompare.png

Like Mark Segall likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events