Forums

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

Updating Reporter field when cloning with automation

john_monteith
Contributor
October 18, 2024

I have an automation rule that clones an issue when it is created into a different project area.

Move issue rule capture 2.PNG

The problem I am having is that the Reporter field in the cloned issue is given the value: "Automation for Jira". I have tried the following to fix this:

I have chosen "Reporter" as a field to set during cloning, and set it to "Copy from issue" (shown below), also tried "Copy from trigger issue". I also created a variable "ReporterName" and tried to set it with that smart value.

Reporter capture.PNG

Update to original post, forgot to include the error log for the above action (couldn't get screen image to load):

"Unknown fields set during clone, they may be unavailable for the project/type. Check your custom field configuration. Fields ignored - Reporter (reporter)"

I also tried to edit the Reporter field once the issue was created, I have admin level permissions including Modify Reporter.

Reporter capture 2.PNG

 

I inserted an audit log just before the Edit Issue Fields action and the issue key and variable were correct. but this is the error I am getting:

Log capture.PNG

I'm sure I'm missing something, but I don't know what it is. Any help would be appreciated and enlightening.

4 answers

1 accepted

4 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2024

Hi @john_monteith 

First, this could be a timing problem caused by the Issue Created trigger.  That one can fire so quickly that all data is not yet present, and so when you try to set the Reporter during the clone it doesn't work.  To fix that, I recommend always adding the Re-fetch Issue action immediately after the Issue Created trigger.  That will slow down the rule a bit and reload the data before proceeding.  Please try that first and re-test.

Kind regards,
Bill

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2024

Just a heads up that something is "glitching" in the community for posts, and so you may see multiple posts for my same answer.

john_monteith
Contributor
October 18, 2024

Thanks Bill, that was actually something I considered, and I didn't mention it in my post because it didn't seem to help. After I branched to the most recently created issue, I tried doing a re-fetch of the issue data then editing the issue and I got the same error as above about inactive user.

refetch capture.PNG

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2024

Thanks for that information, John!

What version of Jira are you using: Cloud, Server, or Data Center?

And if your version is Cloud, what types of project are involved: company-managed or team-managed?

What is the scope of your rule (in the details at the top): single-project, multiple-project, or global?

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2024

Let's try to set the value in the Reporter field directly with a smart value.  Please enter this in the field:

{{triggerIssue.reporter.accountId}}

When it appears below the field. select it to use in the clone action.

john_monteith
Contributor
October 18, 2024

Unfortunately, that did not work, logged same error:

"Unknown fields set during clone, they may be unavailable for the project/type. Check your custom field configuration. Fields ignored - Reporter (reporter)"

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2024

Hmmm...have you checked if there are multiple fields named Reporter set up for your site?

john_monteith
Contributor
October 18, 2024

There are no custom fields for Reporter, just using the default Jira field. Both projects use the same screen scheme and field configuration for the issue type I'm working with and the screen layout in both projects includes that field.

john_monteith
Contributor
October 18, 2024

Moved from lower in post:

To answer your questions:

  • Jira Cloud
  • Company managed
  • Software
  • Trigger and clone are in different projects but the scope is multiple projects with all relevant projects included.

The rule works fine except for this issue with the Reporter field.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2024

FYI, after a quick test rule, this scenario is working for me with Jira Cloud, two company-managed, software projects, and a multiple-project scope rule.  I was able to copy the Reporter from the issue directly.

Who is creating the trigger issue: a person, another rule, or an external process?

Are you changing the Reporter field when creating the issue, or letting it default to the person creating the issue?

 

After the Re-fetch Issue action, please add a Log action to show this:

Reporter name: {{triggerIssue.reporter.displayName}} and id: {{triggerIssue.reporter.accountId}}

Re-test and check if that matches what you expected.

john_monteith
Contributor
October 18, 2024

I will check that out, in answer to your question, I am creating the trigger issue and the reporter is set by default. The trigger issue has the correct reporter name.

 

john_monteith
Contributor
October 18, 2024

I actually took your suggestion and put that log entry in 3 places to see if it changed anywhere. The name and id are consistent, and the Id is mine.

Log capture 4.PNG

john_monteith
Contributor
October 18, 2024

I decided to see what happened if I changed "Reporter" from a required field to an optional field. The trigger issue when it is created still captures my name as the reporter. But when I try to set the reporter value during the cloning action I get the same error as before. However if I try to edit the reporter field after the cloned issue is created, the Reporter value does change, however it is changed to "Anonymous". not the value I supplied. I think the problem lies in that I am deemed an "inactive user" and I don't know what is causing that.

Is the "actor" in your functioning rule "Automation for Jira"?

john_monteith
Contributor
October 18, 2024

I now have it working, it still won't set the value during the cloning process but I can edit the cloned issue field after creation if I use a variable that is set to the value of {{initiator}}.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2024

I am glad to learn you have it working now.

And when I tested, I did leave the rule actor as the default Automation for Jira user.

john_monteith
Contributor
October 18, 2024

I was looking at that as a possible reason for the "Inactive user" designation. Apparently, Jira didn't like my using the ".displayname" portion of my variable creation and shortening it to just the smart value that returned the id was what it needed.

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2024

removing duplicate post

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2024

removing another duplicate post

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2024

removing the first duplicated post :^)

john_monteith
Contributor
October 18, 2024

Moved comment to main discussion thread

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events