---
title: "Getting and Setting Custom Fields"
canonical: "https://support.appfire.com/space/PSJC/491001743/Getting%20and%20Setting%20Custom%20Fields"
format: markdown
---
> Macro (aura-html)


## Implicit Context

Whenever reading or storing a custom field value, the SIL Engine must be given an issue context so that it can connect those values to an issue. In most scripting environments (such as a listener or a custom workflow), the context is already provided.

### Getting a Custom Field Value by Id

|  |
| --- |
| ```
string value = customfield_1234;
``` |

### Getting a Custom Field Value by Name

|  |
| --- |
| ```
string value = #{custom field name};
``` |

### Setting a Custom Field Value by Id

|  |
| --- |
| ```
customfield_1234 = value;
``` |

### Setting a Custom Field Value by Name

|  |
| --- |
| ```
customfield_1234 = #{custom field name};
``` |

## Explicit Context

There are times when you must explicitly declare the context of an issue. This is especially useful when looping through an array of issues.

### Getting a Custom Field Value by Id

|  |
| --- |
| ```
string value = key.customfield_1234;
``` |

### Getting a Custom Field Value by Name

|  |
| --- |
| ```
string value = key.#{custom field name};
``` |

### Setting a Custom Field Value by Id

|  |
| --- |
| ```
%key%.customfield_1234 = value;
``` |

### Setting a Custom Field Value by Name

|  |
| --- |
| ```
%key%.customfield_1234 = #{custom field name};
``` |


> ℹ️ When setting custom fields using an explicit context, you must surround the issue variable with percent signs.

## Additional Help

Need help implementing this script? Talk to me directly to me by clicking on the bot on this page.