# Getting the RecurringJobId from a JobId in FilterAttribute

**URL:** <https://discuss.hangfire.io/t/getting-the-recurringjobid-from-a-jobid-in-filterattribute/1152>\
**Category:** question\
**Tags:** recurring\
**Created:** [July 23, 2015, 11:45pm UTC](https://discuss.hangfire.io/t/getting-the-recurringjobid-from-a-jobid-in-filterattribute/1152 "2015-07-23T23:45:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Massanu](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@Massanu](https://discuss.hangfire.io/u/Massanu)\
**Post date:** [July 23, 2015, 11:45pm UTC](https://discuss.hangfire.io/t/getting-the-recurringjobid-from-a-jobid-in-filterattribute/1152/1 "2015-07-23T23:45:30Z")

</div>

Hi,

Is there a way to get the RecurringJobId from a JobId within a FilterAttribute

Example

```
RecurringJob.AddOrUpdate<DoThat>("MyJob", x => x.DoThis(), Cron.Minutely);

```

Within the FilterAttribute

```
public void OnPerforming(PerformingContext filterContext)
{
    var jobId = filterContext.JobId;
    // i would like here to get "MyJob" string value based on the jobId
    var recurringJobId = ??
}
```

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [July 27, 2015, 10:15am UTC](https://discuss.hangfire.io/t/getting-the-recurringjobid-from-a-jobid-in-filterattribute/1152/2 "2015-07-27T10:15:28Z")

</div>

What do you want to do with recurring job id here?

---

<div class="post-metadata">

**Author:** ![Lineker\_Tomazeli](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/lineker_tomazeli/32/1227_2.png) [@Lineker\_Tomazeli](https://discuss.hangfire.io/u/Lineker_Tomazeli)\
**Post date:** [February 12, 2018, 8:13pm UTC](https://discuss.hangfire.io/t/getting-the-recurringjobid-from-a-jobid-in-filterattribute/1152/3 "2018-02-12T20:13:40Z")

</div>

I would like to get the recurring job id at this level so I can check if is paused.  
Using the technique explained here [Pause/disable recurring job](http://hangfire.discourse.group/t/pause-disable-recurring-job/125/5)

---

<div class="post-metadata">

**Author:** ![KrHr](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/krhr/32/1301_2.png) [@KrHr](https://discuss.hangfire.io/u/KrHr)\
**Post date:** [April 18, 2018, 10:51am UTC](https://discuss.hangfire.io/t/getting-the-recurringjobid-from-a-jobid-in-filterattribute/1152/4 "2018-04-18T10:51:57Z")

</div>

Hi @Massanu  
This thread is long dead, but did you managed to get the recurringJobId? I’ve got similar problem: [How to check if BackgroundJob was created by RecurringJob, not launched from eg. Dashboard?](http://hangfire.discourse.group/t/how-to-check-if-backgroundjob-was-created-by-recurringjob-not-launched-from-eg-dashboard/4579)

---

<div class="post-metadata">

**Author:** ![RupertAvery](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/rupertavery/32/2080_2.png) [@RupertAvery](https://discuss.hangfire.io/u/RupertAvery)\
**Post date:** [May 14, 2020, 3:57am UTC](https://discuss.hangfire.io/t/getting-the-recurringjobid-from-a-jobid-in-filterattribute/1152/5 "2020-05-14T03:57:03Z")

</div>

I used the following code in a FilterAttribute to get the recurringJobId.

```auto
filterContext.Connection.GetJobParameter(filterContext.BackgroundJob.Id, "RecurringJobId")

```

I needed to make a id-specific disableconcurrentexecution attribute
