How do I assign an issue using a custom context field?

Sarah Isaacs February 23, 2024

Hi ya

I need to assign an issue and maybe the epic to a content writer.

I have created a drop down context field. So that when the Project Lead creates the epic they can chose who will be the writer.

once the Project lead has created the epic and chosen from the drop down. They run a manual trigger. In this automation I want the assignee to become the name(person) who is now in the context drop down field?

I have tried using an edit action - but the field is not a custom field.

I have tried a smart value {{issue.customfield_Content Writer}}

I just can't seem to do it?

Any help would be gratefully received.

2 answers

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 23, 2024

Hi Sarah,

If I am following you correctly, you have created a custom field for storing a user name. Then you want to run an automation that copies the value of this field into the Assignee field at some point. Correct so far? 

But when you are creating the automation rule, you do not see the custom field name when trying to Copy the Assignee from that field. Is that the case? 

If so, did you create the custom field in a separate tab or window in your browser and already had your Automation Rules tab open? If so, you will need to publish your rule as is so you don't lose anything. Then refresh the the page and go back into edit the Assignee field. You should see the custom field now. 

Sarah Isaacs February 23, 2024

Hi @John Funk 

 

Yes you are following correctly.

However the field is a context field. Its just not there no matter what I try.

This is the try to put it in within my manual trigger:

image.png

This is a try with the trigger being a value change:

image.png

 This is the try:

Using a edit issue Fields - as I read a previous post you wrote and thought this might work.

Nothing works. 

I've even changed the access to an open project as I wondered if that might be it.

Any help would be amazing. Thanks

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 25, 2024

I see that you are creating a Sub-task after the auto transition. I assume you want to assignee the issue to the Sub-task and not the trigger issue When you are creating the Sub-task, why not just add the value in the Assignee field? 

Click the 3 dots beside the field and click Copy. Then click on the words Current Issue and in the popup that comes, change the Current Issue to Trigger Issue and select the Content Writer field there. 

Sarah Isaacs February 25, 2024

Hey @John Funk @Jack Brickey 

Thanks so much for trying to help me. I'm new to this jira automations thing and so I'm doing my best. So I believe I have tired what you both suggested. 

This is what I wanted to do in a nut shell:

1. The Team leader creates a new Epic (which in our project is a book)

2. When they create the epic they fill in the context people fields (writer, Editor, PO, Designer etc)

3. Then they run a manual trigger automation.

 

  • The Manual trigger Automation then needs to:
  • Create a task(writing card)within the epic just created
  • The Task is called epic name and writing card 1
  • This task needs to be assigned to the person in the (context people field called Content Writer New)
  • Then a sub task is created which belongs to the Writing card 1 and so the Epic (name of the book)
  • Then the sub task is also assigned to the Content Writer New.

I'm a bit lost as to how to do this smart value not a smart value

I'd like the epic to always hold the various job roles and then when I create tasks and then sub tasks to change the assignees to the ones held in the people fields in the epic.

Is this possible please?

Do I need to set up a separate automation that states assignee = People Context field epic?

my knowledge is just not great I'm sorry.

This is my automation so far:image.png

 

Everything works apart from the assignee.

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 25, 2024

Hi @Sarah Isaacs , please share how you are setting the Assignee in each case (task, subtask).

The following works fine for me.

For the Task create I used the following smartvalue. You need to replace "sub-assignee" with your custom field name. IMPORTANT: The custom field type needs to be People type.

 {{issue.sub-assignee.accountId}}

For the subtask I set the Assignee by copying from the parent (newly create task). Note I added two Re-fetch data actions to ensure the task create action has time to complete.

 

IMG_3741.png

Like John Funk likes this
0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 23, 2024

Hi @Sarah Isaacs , I am missing something here. Why would the project lead not simply select the writer by using the Assignee field itself?

Sarah Isaacs February 23, 2024

Hi @Jack Brickey yes this is a reasonable question. :) So the name project lead was maybe misleading. As its a Team Leader who will create the Epic. What we want is a dynamic way of assigning the (writer, designer etc) Then every time the various issue types writing, design, illustration and their associated issues(cards) move through production we want the sub tasks assigned to whoever was set up in the initially in the epic in the context custom fields. Is this possible.?  sort of like a look up? Thanks any help would be amazing

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 23, 2024

Ok so looking back at your OP you state "...but the field is not a custom field". If not a custom field what is it? You must've created a custom field that the user can select from drop-down, right? Would you mind providing an image of your automation rule. Also what does the audit log tell you when you try to run the rule.

Sarah Isaacs February 23, 2024

@Jack Brickey  Hey Jack, Yes this is where I create the fields:image.png

 

So why I say its not a custom field I mean its not reporter, creator etc. 

This is one of the errors I get:

image.png

 

The user has access and is a member. Its all spelt the same. 

I'm going to try Initial and surname. But then its not ideal as I'd like their name. Can you covert a Name to the Initial and Surname if that worked. Like dare I say it a look up.

Thanks a million for your help so far

 

Sarah Isaacs February 23, 2024

Same error with Initialimage.png and surname

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 23, 2024

Hi @Sarah Isaacs ,

Thank you for all of the details that certainly helps. The first thing I observe, is that for your assign issue action you need to be sure that you are referencing the new subtask not the issue associated with the trigger. I think you simply want to set the Assignee as part of the issue creat action. Similar to what I show in the image below. Also, I am assuming you are using the "People" custom field option to create all of your fields (writer, editor, etc.) used to copy into the Assignee.

The smart value syntax should be as follows I think...

{{issue.sub-assignee.accountId}}

IMG_3732.png

Sarah Isaacs March 4, 2024

Hey Jack and John, Thank you so much it works. You are fantastic.

Like John Funk likes this
Sarah Isaacs March 4, 2024

@Jack Brickey @John Funk  Thanks so much for all your help the assignee worked.

 

The next issue I face is how to I copy the peoples names from my epics custom fields into the custom fields on the task.

I.e. The content writer that I have put into the Epic field Rhino Content Writer that person. Copy that data into the Rhino Content Writer Field within the Task in my case Writing card 1. 

I thought I could do an Edit issue Fields and then just to a copy from parent or trigger issue etc. But I can't as I can't find my field - Rhino Content Writer in the drop down list as it does appear it says to use advance field editing.  Please help I just don't know how to do this?

 

Like John Funk likes this
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 5, 2024

You should try using the custom field ID which you can find ate the end of the URL when editing the custom field. Here is an example...

https://xxxxxxx.atlassian.net/secure/admin/EditCustomField!default.jspa?id=10089

then you reference as follows...

{{issue.customfield_10089.accountId}}

Like John Funk likes this
Sarah Isaacs March 6, 2024

Hey @Jack Brickey @John Funk 

 

So I spent many hours trying and read and basically trying to teach myself.

I'm wondering if what I want to do just isn't possible?

Here's why I'm wondering that and why I want to do what I want to do.

What I want to do.

  1. the user creates and epic and adds the values in to my custom people fields that I have added to the epic issue type, the task issue type (writing for us) and the sub task issue type. The fields are (lead editor, designer, illustrator) etc
  2. Once this data has been add to the epic the user runs a manual trigger. This automation creates the first card/task for the writing part of our project, assigns the content writer to the task, and then creates a sub task(kick off meeting) that belongs to the parent and then the epic. The kick off meeting sub task assigns to the content writer from getting the value from the epic.

This all currently works great.

  1. Next the user added the newly created task to the sprint - would love if this automatically happened but i can't get that to work.
  2. Once the user has completed the first sub task (kick off) they select done. Then another automation moves the writing task/card to the next column writing and creates the next subtask - 1. synopsis. 

This all works.

But I would like the Synopsis sub task to be assigned to the Content Writer. This is where I am struggling. So that value is sitting in the epic. I don't know if I should have through the manual task copied the values from the epic to the Task/card (writing) and then in turn to the sub task or not?

The info I have found is that I can't so this as I would need a JMWE Plugin to run a JSON script. I can't do an edit issue because a people custom field does not exist within the drop down. I thought I could use the additional option so tried this: 

 "fields": {

    "Rhino Content Writer": "{{lookupIssues('Epic Link', issue.key).first.fields['Rhino Content Writer'].name}}"

  }

}

 

This doesn't work and gives me an error of 

 

Error while rendering additional fields.

Failed to get value for lookupIssues('Epic Link', issue.key).first.fields['Rhino Content Writer'].name

 

Am I on the right lines or have I completely lost myself in Jira?

Any help would really be appreciated as if this can’t be done it will dramatically change the project. Thanks so much

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 6, 2024

So you said the Content Writer is copied from the Epic to the Writing task as the assignee. Why don't you just copy the Assignee from the parent Task to the Sub-task when you create the Sub-task? 

Another option is to put the Content Writer field in all of the issue types and screens and copy it down when you create the issues. Then Copy from that field to the Assignee when needed. 

Sarah Isaacs March 6, 2024

Hi ya @John Funk 

Yes so the Content Writer people field is all good as I copy this into the Assignee for the Task and then the sub task.

However the next sub task (belonging to the same task) needs to be assigned to the Lead Editor. This value is within a people field on the Epic. So I don't know how to pass this down the line and at what point. Can all the values within the epic people custom fields be added to the people fields on the (issue type writing) for the task? Should this be done within the manual trigger? If so how do I do this? As the Edit Action doesn't let me select a people field its just not available.

I need a way to pass the value for each people custom field from the epic to the writing task and then to the sub task when the sub task relates to that person i.e. Lead Editor.

I'm a bit lost with it. Thank you

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 6, 2024

Is this a Team-managed project, I assume? Did you create the people fields as shared custom fields? Or just independently in the project?

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2024

Unfortunately, in doing some more research I have found this:

  • Custom fields: All People custom fields in team-managed projects currently aren’t supported by Jira Cloud automation. This means that your automation rules won’t be able to access values or set values in any People fields.

That's why you are not seeing the fields. 

I don't know how much data you have in this project, but you might consider creating a new project of Company-managed type so all of those things you want to do can be accomplished. 

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2024

@John Funk , I don't use TMP and was unaware of this limitation. Can you share the reference for that info? Is there a JAC for it?

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2024

Hey Jack - not sure if there is a JAC ticket or not. This is where I found it:

https://support.atlassian.com/cloud-automation/docs/limitations-in-team-managed-projects-for-automation-rules/

 

Sarah Isaacs March 7, 2024

Hi @John Funk @Jack Brickey 

Wow thanks guys. So relieved that its not all down to my bad Jira skills, but now a bit loss as what to do? Yes its a Team Managed Board. Therefore, these are my questions as this is the only Jira Environment I know. 

Do you automatically get the Company Managed Type style of project as part of the Jira subscription or is it something you have to pay extra for or buy into. 

Does a CW project work the same as a Team Managed, sprints, automations etc?

I'm guessing this could also be the reason the sprint isn't available in the edit issue also?

Is there any other way around this? Is there a smart value, script or something that can convert a name of a person if I put it in a custom description field into an ID to put into an assignee field within an automation? 

If so the massive question how please? 

Any advice is much appreciated? Thanks a million

Sarah Isaacs March 7, 2024

How would I select of find a CW project?

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2024

Hi @Sarah Isaacs , so unless you have the proper admin permissions you will not be able to create a CMP. You would need to work with your Org admin for this. If you do have the necessary admin privileges you can click on Projects > view all projects > create project and find the proper CMP template.

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2024

Here is the closest open Suggestion I found - https://jira.atlassian.com/browse/AUTO-421 

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2024

@Sarah Isaacs , I wonder if you could alter your process and leverage a text field. Just a thought and something to try out.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2024

Yes, the Company-managed ones are there  - but just sort of hidden for some reason. 

If you are using Jira Software (vs. Jira Work Management), then click on Projects, Create Project.  Then click on Software Development on the left. 

Then Click Kanban. Then click Use Template. 

You should be able to select Company Managed Project in the blue on the right side. 

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2024

By the way, Jack is old and senile. But feel free to trust him if you want. 

 

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2024

LOL! that is so true!

Like John Funk likes this
Sarah Isaacs March 7, 2024

You Guys - ha ha 

I realise I'm being repetitive but just to confirm there really isn't any other way to achieve what I'm looking for with my current board set up. Just triple checking before I try to explain this to my Admin. Thanks so much @Jack Brickey @John Funk 

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2024

You might could do it as Jack suggested with a text field. You could certainly invest a little time to try it out. But you should put the email address of the user in the text field because that's really what Jira connects to for users. Then we can see if we can copy that value into the Assignee field. 

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2024

If you have a 'finite' and manageable number of users then you could use an if/else block...

if writer = John then assignee = John Funky

else if writer = Jack then assignee = Jack Awesome

else if writer = ...

but this would no be easily maintained or scaled.

if I get some time I will play with this and respond if I come up with something better.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2024

else if writer = Jack then assignee = Jack Awesome

That line will fail every time. Just saying

Like Jack Brickey likes this
Sarah Isaacs March 15, 2024

Hey How are you both @John Funk @Jack Brickey 

 

So I've been testing a few solutions today still using my team managed board as I'm waiting for my Admin to say yes to A company Managed board. 

I've tired to use the copy field within the workflow in the above suggestion this doesn't do anything.

Then I tried to copy from a text field that had the persons email address into the assignee this doesn't work or my not doing it correctly. 

I then looked at the JSON solution from the above info you posted @Jack Brickey I just don't understand that one and when I try to use it it disables the automation.

Then I can't seem to do an if else.

Any further advice would be amazing

Thanks chaps

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2024

So let's review. You created a new custom single line text field. Then you placed the email address of a user in that field. Then you tried to copy the value of the custom text field to the Assignee field. Is that what you did?

And if so, when the automation rule fires, it runs but doesn't update the Assignee field? 

And if so, what does the audit log show for the rule when it runs? Can you share details? 

Sarah Isaacs March 25, 2024

Hi @John Funk 

Thanks so much for thinking about my question again. So I have come up with a solution. Probably not the best solution but it works. So I create an issue which is always part of the same epic and then I assign from the epic using a smart value. Not completely what I wanted but it does work. 

This however creates/adds to another problem I have. Which is that the new task (writing Card 2) that I create within an automation goes into the backlog and I cannot through the automation assign this to the current sprint. The Sprint field/value within the Edit action simply does not exist. I mentioned this in another question to @Trudy Claspill

At the moment I have to send an email to the project lead to add that card from the backlog to the sprint. Which is not great. Very manual.

Does anyone know if the reason for the lack of the sprint field is related to it being a team managed board or is it something that the admin has turned off. I need to email my IT department but am not sure what to ask for. The reason I have ask this question here is because, @John Funk you uncovered that other limitation with a team managed board with regards to people fields. Is it related do you think? 

As everyone knows I'm new to this and doing my best to learn.

Thanks so much

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 26, 2024

Sorry - I really don't work much with Team-managed projects - for all of these reasons you keep running into. Do yourself a favor and ditch them for Company-managed projects only in the future.  :-)

Suggest an answer

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

Atlassian Community Events